You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run this code, very long message with Ruby's Hash format will be shown. Here's the beginning of the message.
#<ZbxAPI_ExceptionPermissionError: {"code"=>-32500, "message"=>"Application error.", "data"=>"Cannot import template \"Template1\", linked templates \"Template2, Template3\" do not exist.", "debug"=>...
...
...
"function"=>"execute","class"=>"CJSONrpc","type"=>"->","args"=>[]}]}>
So I tried to output only the value of "message" key by running following code.
pevar["message"]
However, following exception message has appeared.
./script.rb:73:in`rescue in block in import_templates': undefined method `[]' for #<ZbxAPI_ExceptionPermissionError:0x18db438> (NoMethodError) from ./script.rb:30:in `block in import_templates'from./script.rb:27:in`each' from ./script.rb:27:in `import_templates' from ./script.rb:79:in `<main>'exitstatus1
It seems that the error has occurred because it's not Hash.
Is it possible to get ZbxAPI_ExceptionPermissionError as a Hash object?
The text was updated successfully, but these errors were encountered:
I wrote following code which is intended to show some error messages from Zabbix.
When I run this code, very long message with Ruby's Hash format will be shown. Here's the beginning of the message.
So I tried to output only the value of "message" key by running following code.
However, following exception message has appeared.
It seems that the error has occurred because it's not Hash.
Is it possible to get ZbxAPI_ExceptionPermissionError as a Hash object?
The text was updated successfully, but these errors were encountered: