* allow serviceData to override cacheSeconds with a longer value * prevent [endpoint] json cacheSeconds property exceeding service default * allow ShieldsRuntimeError to specify a cacheSeconds property By default error responses use the cacheLength of the service class throwing the error. This allows error to tell the handling layer the maxAge that should be set on the error badge response. * add customExceptions param This 1. allows us to specify custom properties to pass to the exception constructor if we throw any of the standard got errors e.g: `ETIMEDOUT`, `ECONNRESET`, etc 2. uses a custom `cacheSeconds` property (if set on the exception) to set the response maxAge * customExceptions --> systemErrors * errorMessages --> httpErrors
20 lines
697 B
JavaScript
20 lines
697 B
JavaScript
const documentation = `
|
|
<p>
|
|
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g.
|
|
<a href="https://gitlab.com/gitlab-org/gitlab" target="_blank" >gitlab-org/gitlab</a> ).
|
|
Note that only internet-accessible GitLab instances are supported, for example
|
|
<a href="https://jihulab.com" target="_blank" >https://jihulab.com</a>,
|
|
<a href="https://gitlab.gnome.org" target="_blank" >https://gitlab.gnome.org</a>, or
|
|
<a href="https://gitlab.com" target="_blank" >https://gitlab.com</a>.
|
|
</p>
|
|
`
|
|
|
|
function httpErrorsFor(notFoundMessage = 'project not found') {
|
|
return {
|
|
401: notFoundMessage,
|
|
404: notFoundMessage,
|
|
}
|
|
}
|
|
|
|
export { documentation, httpErrorsFor }
|