aboutsummaryrefslogtreecommitdiff
path: root/scripts/gendispatch.lua
diff options
context:
space:
mode:
authorJakob Schnitzer <mail@jakobschnitzer.de>2017-04-24 11:35:10 +0200
committerJakob Schnitzer <mail@jakobschnitzer.de>2017-04-24 11:35:10 +0200
commitff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (patch)
tree526b1df09b06121bdbc6ef5254ef53821958a6cb /scripts/gendispatch.lua
parent4049492b6d7b8805686b14dbacb3b729abd03308 (diff)
parent7f6d3d305269fd1139bc2aec9a91bf98ad595199 (diff)
downloadrneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.gz
rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.bz2
rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.zip
Merge branch 'master' into option-fixes
Diffstat (limited to 'scripts/gendispatch.lua')
-rw-r--r--scripts/gendispatch.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua
index 45a4f4a4de..0ee3ae6475 100644
--- a/scripts/gendispatch.lua
+++ b/scripts/gendispatch.lua
@@ -225,8 +225,7 @@ for i = 1, #functions do
end
output:write('\n')
output:write('\n if (args.size != '..#fn.parameters..') {')
- output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
- output:write('\n error->set = true;')
+ output:write('\n api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
output:write('\n goto cleanup;')
output:write('\n }\n')
@@ -251,8 +250,7 @@ for i = 1, #functions do
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
end
output:write('\n } else {')
- output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");')
- output:write('\n error->set = true;')
+ output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");')
output:write('\n goto cleanup;')
output:write('\n }\n')
else
@@ -292,7 +290,7 @@ for i = 1, #functions do
output:write('error);\n')
end
-- and check for the error
- output:write('\n if (error->set) {')
+ output:write('\n if (ERROR_SET(error)) {')
output:write('\n goto cleanup;')
output:write('\n }\n')
else