test(imagorvideo): fallback image tests

This commit is contained in:
Adrian Shum 2022-09-16 21:56:09 +08:00 committed by GitHub
parent d9c697a0b2
commit 035cf78b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 14 deletions

View file

@ -57,6 +57,10 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp
if err == nil || out != nil {
return
}
if _, ok := err.(imagor.ErrForward); ok {
return
}
err = imagor.NewError(err.Error(), 406)
// fallback image on error
out = imagor.NewBlobFromBytes(transPixel)
if p.FallbackImage != "" {