Module: Extension::Tasks::UserErrors

Included in:
CreateExtension, UpdateDraft
Defined in:
lib/project_types/extension/tasks/user_errors.rb

Constant Summary collapse

USER_ERRORS_FIELD =
"userErrors"
MESSAGE_FIELD =
"message"
USER_ERRORS_PARSE_ERROR =
"Unable to parse errors from server."

Instance Method Summary collapse

Instance Method Details

#abort_if_user_errors(context, response) ⇒ Object



11
12
13
14
15
16
# File 'lib/project_types/extension/tasks/user_errors.rb', line 11

def abort_if_user_errors(context, response)
  return if response.nil?

  user_errors = response.dig(USER_ERRORS_FIELD)
  output_all_user_errors(context, user_errors)
end