api-problem-bundle icon indicating copy to clipboard operation
api-problem-bundle copied to clipboard

Limit transformation to a url regex

Open leroy0211 opened this issue 6 years ago • 1 comments

Would it be possible to limit the execution of the transformation to a route regular expression like ^/api/? So the transformation of the exceptions wouldn't occur on other places of the application which sometimes might throw an HttpException when accepting application/json but shouldn't be transformed.

This might be usefull for some applications which are not yet fully based on api's, or for some who want to migrate to newly structured api's

leroy0211 avatar Jun 29 '19 07:06 leroy0211

Hello @leroy0211,

Sound like a solid idea! Maybe best to inject a RequestMatcherInterface into the listener so that you can do whatever matching you want. I would surely accept a PR for that.

veewee avatar Jul 01 '19 06:07 veewee