Skip to content

Commit

Permalink
examples: Native.Error.throw -> raise
Browse files Browse the repository at this point in the history
  • Loading branch information
seliopou committed Sep 3, 2014
1 parent ac53209 commit c8a96c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/Todo.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import String
-- There are some cases in the code below that should never happen and in fact
-- cannot ever happen. In other languages, you'd use an `asset false`
-- expression, or `undefined` to indicate that the case is impossible. In Elm,
-- you can call `Native.Error.throw`.
-- you can call `Native.Error.raise`.
--
import Native.Error

Expand Down Expand Up @@ -104,7 +104,7 @@ startEdit m i =
changeEdit : Model -> String -> Model
changeEdit m d =
case m.editing of
Nothing -> Native.Error.throw "trying to edit while not editing"
Nothing -> Native.Error.raise "trying to edit while not editing"
Just (_, i) -> { m | editing <- Just (d, i) }

-- Complete editing by setting the description of the current edit item to the
Expand All @@ -113,7 +113,7 @@ changeEdit m d =
commitEdit : Model -> Model
commitEdit m =
case m.editing of
Nothing -> Native.Error.throw "trying to finishing editing while not editing"
Nothing -> Native.Error.raise "trying to finishing editing while not editing"
Just (t, i) -> let m' = setDescription m i t in { m' | editing <- Nothing }


Expand Down

0 comments on commit c8a96c3

Please sign in to comment.