The following is a json.jbuildermethod intended to respond to an API call.
json.jbuilder
if @error_code_98? json.set! :chain_category do json.set! :error, @e