Actions
Bug #3004
closedInconsistent error behavior (JSON) when creating a new job
Story points:
0.5
Updated by Ward Vandewege over 10 years ago
- Subject changed from Inconsistent error behavior (JSON) when creating a new job to Inconsistent error behavior (JSON) when creating a new job / #<ArgumentError: Specified script_version does not resolve to a commit>
ensure_script_version_is_commit in app/models/job.rb raises an ArgumentError if the specified script_version does not resolve to a commit.
render_errors in app/controllers/application_controller.rb reduces that to a JSON response:
render json: { errors: errors }, status: status
This returns a JSON with key 'errors', value an array.
create in app/controllers/arvados/v1/jobs_controller.rb has this bit of code:
[:repository, :script, :script_version, :script_parameters].each do |r| if !resource_attrs[r] return render json: { :error => "#{r} attribute must be specified" }, status: :unprocessable_entity end end
That returns a JSON with key 'error', and value a string.
arv-run-pipeline-instance tests for the key 'errors', not 'error'.
I suggest the latter is converted to
:errors => ["#{r} attribute must be specified"]
Updated by Ward Vandewege over 10 years ago
- Subject changed from Inconsistent error behavior (JSON) when creating a new job / #<ArgumentError: Specified script_version does not resolve to a commit> to Inconsistent error behavior (JSON) when creating a new job
Actions