cssurl icon indicating copy to clipboard operation
cssurl copied to clipboard

Error handler for rewrite in URLRewriteStream

Open chmanie opened this issue 10 years ago • 1 comments

If there's an error in the transform function (called replacer) it just bubbles up to the highest scope. I'd like to have more control over errors thrown there so I'd propose to wrap the actual rewriting into a try-catch and let the stream emit an error event when it is caught. This would be the expected behaviour when dealing with a stream (at least for me).

I already prepared a PR, let me know if this is acceptable for you.

chmanie avatar Aug 19 '15 14:08 chmanie

Sounds good.

nzakas avatar Aug 20 '15 01:08 nzakas