summaryrefslogtreecommitdiff
path: root/lib/ffi_yajl/encoder.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-01-22 08:32:09 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-01-22 08:32:32 -0800
commit36492e4bd8d1521945466c39515eb9a3a961a72d (patch)
tree6b0d41f9527117dbc67afb7d3ed9f8564a313318 /lib/ffi_yajl/encoder.rb
parent8bc806d4fc4f22ebb9c38c20838fa0824b5e6c21 (diff)
downloadffi-yajl-36492e4bd8d1521945466c39515eb9a3a961a72d.tar.gz
catch and raise invalid string error better
Diffstat (limited to 'lib/ffi_yajl/encoder.rb')
-rw-r--r--lib/ffi_yajl/encoder.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb
index 58b817a..004c006 100644
--- a/lib/ffi_yajl/encoder.rb
+++ b/lib/ffi_yajl/encoder.rb
@@ -46,6 +46,8 @@ module FFI_Yajl
raise FFI_Yajl::EncodeError, "Invalid number: cannot encode Infinity, -Infinity, or NaN"
when 6 # yajl_gen_no_buf
raise FFI_Yajl::EncodeError, "YAJL internal error: yajl_gen_get_buf was called, but a print callback was specified, so no internal buffer is available"
+ when 7 # yajl_gen_invalid_string
+ raise FFI_Yajl::EncodeError, "Invalid UTF-8 string: cannot encode to UTF-8"
else
raise FFI_Yajl::EncodeError, "Unknown YAJL Error (#{status}), please report this as a bug"
end