mirror of
git://git.savannah.gnu.org/guix/data-service.git
synced 2023-12-14 03:23:03 +01:00
Provide more information about revision processing errors
In the compare package derivations response.
This commit is contained in:
parent
f7b823cfd9
commit
044a905c1d
|
@ -648,28 +648,46 @@
|
||||||
'(application/json text/html)
|
'(application/json text/html)
|
||||||
mime-types)
|
mime-types)
|
||||||
((application/json)
|
((application/json)
|
||||||
|
(letpar& ((base-job
|
||||||
|
(and=> (match (assq-ref query-parameters 'base_commit)
|
||||||
|
(($ <invalid-query-parameter> value)
|
||||||
|
(and (string? value) value))
|
||||||
|
((? string? value) value)
|
||||||
|
(_ #f))
|
||||||
|
(lambda (commit)
|
||||||
|
(with-thread-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(select-job-for-commit conn commit))))))
|
||||||
|
(target-job
|
||||||
|
(and=> (match (assq-ref query-parameters 'target_commit)
|
||||||
|
(($ <invalid-query-parameter> value)
|
||||||
|
(and (string? value) value))
|
||||||
|
((? string? value) value)
|
||||||
|
(_ #f))
|
||||||
|
(lambda (commit)
|
||||||
|
(with-thread-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(select-job-for-commit conn commit)))))))
|
||||||
(render-json
|
(render-json
|
||||||
`((error . "invalid query")
|
`((error . "invalid query")
|
||||||
(query_parameters
|
(query_parameters
|
||||||
.
|
.
|
||||||
,(map
|
,(map
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((name . val)
|
((key . val)
|
||||||
(cons
|
(cons key
|
||||||
name
|
(match val
|
||||||
(cond
|
(($ <invalid-query-parameter> value message)
|
||||||
((invalid-query-parameter? val)
|
`((invalid_value . ,value)
|
||||||
`((invalid
|
(message . ,(call-with-output-string
|
||||||
. ,(with-output-to-string
|
(lambda (port)
|
||||||
(lambda ()
|
(sxml->html message port))))))
|
||||||
(sxml->html
|
((? list? val)
|
||||||
(invalid-query-parameter-message
|
|
||||||
val)))))
|
|
||||||
(value . ,(invalid-query-parameter-value val))))
|
|
||||||
((list? val)
|
|
||||||
(list->vector val))
|
(list->vector val))
|
||||||
(else val)))))
|
(val val)))))
|
||||||
query-parameters)))))
|
query-parameters))
|
||||||
|
(base_job . ,base-job)
|
||||||
|
(target_job . ,target-job)))))
|
||||||
(else
|
(else
|
||||||
(letpar& ((systems
|
(letpar& ((systems
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
Loading…
Reference in a new issue