Add error options for rendering to return errors on failure (#48864)

This commit is contained in:
George Robinson
2022-05-09 19:11:24 +01:00
committed by GitHub
parent 7b9929fffe
commit 897db011eb
3 changed files with 49 additions and 0 deletions

View File

@ -41,6 +41,7 @@ func getRequestTimeout(opt TimeoutOpts) time.Duration {
type Opts struct {
TimeoutOpts
AuthOpts
ErrorOpts
Width int
Height int
Path string
@ -52,6 +53,15 @@ type Opts struct {
Theme models.Theme
}
type ErrorOpts struct {
// ErrorConcurrentLimitReached returns an ErrConcurrentLimitReached
// error instead of a rendering limit exceeded image.
ErrorConcurrentLimitReached bool
// ErrorRenderUnavailable returns an ErrRunderUnavailable error
// instead of a rendering unavailable image.
ErrorRenderUnavailable bool
}
type CSVOpts struct {
TimeoutOpts
AuthOpts