Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
Olian04 committed Jun 18, 2024
1 parent 13ac494 commit 3f75a9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ gleam add handles
```

```gleam
import handles
import gleam/io
import gleam/dict
import gleam/dynamic
import handles
import handles/ctx
pub fn main() {
let assert Ok(template) = handles.prepare("Hello {{name}}")
let assert Ok(string) =
handles.run(
template,
dict.new()
|> dict.insert("name", "Oliver")
|> dynamic.from,
[ctx.Prop("name", ctx.Str("Oliver"))]
)
io.println(string)
Expand Down
12 changes: 12 additions & 0 deletions src/handles/error.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub type TokenizerError {
UnbalancedTag(index: Int)
MissingPropertyPath(index: Int)
MissingBlockArgument(index: Int)
UnexpectedBlockArgument(index: Int)
UnexpectedBlockKind(index: Int)
}

pub type RuntimeError {
UnexpectedTypeError(path: List(String), got: String, expected: List(String))
UnknownPropertyError(key: List(String))
}

0 comments on commit 3f75a9c

Please sign in to comment.