Skip to content

Functionality to fail gracefully in ImageResolver #169

Discussion options

You must be logged in to vote

A possible solution would be to allow GetMetaDataAsync to return either an ImageMetadata or an typed error.

We cannot change the interface. That's a breaking change requiring a major version, there's also no correlation between the types.

We already handle 404s.

IImageResolver sourceImageResolver = await provider.GetAsync(context);
if (sourceImageResolver is null)
{
// Log the error but let the pipeline handle the 404
// by calling the next delegate/middleware in the pipeline.
var imageContext = new ImageContext(context, this.options);
this.logger.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@marklagendijk
Comment options

@JimBobSquarePants
Comment options

@marklagendijk
Comment options

@JimBobSquarePants
Comment options

Answer selected by JimBobSquarePants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants