summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-09-10 21:44:45 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-09-10 21:44:45 +0200
commit37be15261c35d732e6a254b75b77654ad0ad9d97 (patch)
tree34102799ff0f16982d3b7b4c87f5f1b6a4bdd923 /src/shared
parentcfdd37c261bfb814740aa8cec30177f9c5f85d36 (diff)
Transforms some "assert" into error throws.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/struct/map/shr_location.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/struct/map/shr_location.erl b/src/shared/struct/map/shr_location.erl
index e7d4432..f980134 100644
--- a/src/shared/struct/map/shr_location.erl
+++ b/src/shared/struct/map/shr_location.erl
@@ -86,7 +86,11 @@ decode (Map) ->
X = maps:get(<<"x">>, Map),
Y = maps:get(<<"y">>, Map),
- true = (is_integer(X) and is_integer(Y)),
+ if
+ (not is_integer(X)) -> error({map, width, X});
+ (not is_integer(Y)) -> error({map, height, Y});
+ true -> ok
+ end,
validate({X, Y}).