aboutsummaryrefslogtreecommitdiff
path: root/src/client/Utils/Either.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-08-01 00:31:36 +0200
committerJoris Guyonvarch2015-08-01 00:31:36 +0200
commitc345f9daa28e0c174b35413addf78df0a793f8c1 (patch)
tree206f1d9aeed76b5c9e6f6abd24c00a50ec6c54fd /src/client/Utils/Either.elm
parent043d315c4b15608e04a07cd709e4caf5c3758c61 (diff)
downloadbudget-c345f9daa28e0c174b35413addf78df0a793f8c1.tar.gz
budget-c345f9daa28e0c174b35413addf78df0a793f8c1.tar.bz2
budget-c345f9daa28e0c174b35413addf78df0a793f8c1.zip
Adding error feedbacks when adding a payment
Diffstat (limited to 'src/client/Utils/Either.elm')
-rw-r--r--src/client/Utils/Either.elm9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/Utils/Either.elm b/src/client/Utils/Either.elm
new file mode 100644
index 0000000..10c40e3
--- /dev/null
+++ b/src/client/Utils/Either.elm
@@ -0,0 +1,9 @@
+module Utils.Either
+ ( toMaybeError
+ ) where
+
+toMaybeError : Result a b -> Maybe a
+toMaybeError result =
+ case result of
+ Ok _ -> Nothing
+ Err x -> Just x