Skip to content

Create an error filter that catches exceptions and transforms them into IOperationResult #50

@Carl-Hugo

Description

@Carl-Hugo
  • Create the filter in ForEvolve.OperationResults.AspNetCore (review this, maybe creating a standalone project would be best?)
  • Allow the configuration of ExceptionTransformer that could map specific exception type(s) to an IOperationResult allowing customization of the exception convention pipeline. This could be based on, use, or update the concepts of IOperationResultStandardizer.
  • The ExceptionTransformer should support returning any type, no just IOperationResult, making this compatible with any system (including, but not limited to, my old DynamicInternalServerError projcet).
  • Add the filter to the AddForEvolveOperationResultFilters() extension method or create an AddForEvolveOperationResultApiFilters() method to differentiate API filters vs MVC filters (or both); TODO: review/rename these to be more generic and less "OperationResult-centric".

OperationResult-centric stuff could be part of another assembly, following an assembly structure similar to:

  • ForEvolve.ExceptionFilters.Abstraction
  • ForEvolve.ExceptionFilters.AspNetCore ( or ForEvolve.ExceptionFilters.AspNet)
  • ForEvolve.ExceptionFilters.AspNetCore.OperationResults
  • ForEvolve.ExceptionFilters.AspNetCore.DynamicInternalServerError (maybe?)
  • ForEvolve.ExceptionFilters.MediatR (or ForEvolve.ExceptionFilters.VerticalSlice)
  • ForEvolve.ExceptionFilters.MediatR.OperationResults
  • ForEvolve.ExceptionFilters.MediatR.DynamicInternalServerError (maybe?)
  • ...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions