improper jbuilder syntax for output during API error handling

120 Views Asked by At

The following is a json.jbuildermethod intended to respond to an API call.

if @error_code_98?
  json.set! :chain_category do
    json.set! :error, @error_98_messages
  end
end

@error_code_99 = true when said errors arise.
error_98_messages is a concatenation of string that provide an indentifier with the nature of the error. They are accumulated as an array of items are handled by the API action.

When the error hits, the instance variable gets populated, but at the end of the action the return message this the following error

syntax error, unexpected tSYMBEG, expecting ':'
  json.set! :chain_category do

I thought this was respecting the syntax for dynamic attribution, but that is mistaken. Where is the syntax off?

0

There are 0 best solutions below