aboutsummaryrefslogtreecommitdiffstats
path: root/lib/midi
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-22 12:15:05 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-22 12:15:05 +0000
commitce99c90c282a04177bfda54e9df1855e8e6597e6 (patch)
treed82ef94a1c35da5c21ba1b86a3dbc0a6bef84b4b /lib/midi
parenterror handling: scope + registry (diff)
downloadalive-ce99c90c282a04177bfda54e9df1855e8e6597e6.tar.gz
alive-ce99c90c282a04177bfda54e9df1855e8e6597e6.zip
error handling: lib
Diffstat (limited to 'lib/midi')
-rw-r--r--lib/midi/core.moon8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/midi/core.moon b/lib/midi/core.moon
index 4986811..d1930eb 100644
--- a/lib/midi/core.moon
+++ b/lib/midi/core.moon
@@ -110,18 +110,18 @@ inout = Value.meta
apply_range = (range, val) ->
if range\type! == 'str'
- switch range\unwrap!
+ switch range!
when 'raw' then val
when 'uni' then val / 128
when 'bip' then val / 64 - 1
when 'rad' then val / 64 * math.pi
when 'deg' then val / 128 * 360
else
- error "unknown range #{range}"
+ error Error 'argument', "unknown range '#{range!}'"
elseif range.type == 'num'
- val / 128 * range\unwrap!
+ val / 128 * range!
else
- error "range has to be a string or number"
+ error Error 'argument', "range has to be a string or number"
{
:input