aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-24 02:14:14 +0200
committerGitHub <noreply@github.com>2017-04-24 02:14:14 +0200
commit7f6d3d305269fd1139bc2aec9a91bf98ad595199 (patch)
tree965d18fb11d25959e709a18d1c9d1fca0c4df432 /scripts
parent1fe8945748620713402cab77a46501ec5311778b (diff)
parent086c354a0aad2769042dc91bf5bad021109f56e4 (diff)
downloadrneovim-7f6d3d305269fd1139bc2aec9a91bf98ad595199.tar.gz
rneovim-7f6d3d305269fd1139bc2aec9a91bf98ad595199.tar.bz2
rneovim-7f6d3d305269fd1139bc2aec9a91bf98ad595199.zip
Merge #6569 from justinmk/apierror
api: Do not truncate errors <1 MB
Diffstat (limited to 'scripts')
-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