Error handling and debugging #4598
subtle4553
started this conversation in
Ideas
Replies: 1 comment
-
in config, you can change how errors are handled. default is to emit errors as a feed item. you can change this to make it return http 500 instead: see:
please report back if this helps |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Over time I had some cases where feeds couldn't be generated because there's some sort of error for one reason or another. But it seems that RSS bridge doesn't handle errors in a meaningful way. Instead I get new feed items in my reader that display the error and a stack trace. Then I noticed that thrown errors get treated like any other return value in general which doesn't seem right.
Not only do I not see a point in generating a feed if there's an error, it also makes debugging kind of difficult. So, IMO it makes more sense if requesting a feed with an error actually sends a 4xx/5xx status code to the requesting client. I think some clients can list feeds that don't return a 2xx/3xx status code, so it'd also be easy to find broken feeds.
Also, thrown errors could be displayed on the feed preview page (on a page with this URL pattern:
?action=display&bridge=SomeBridge
) instead of potential feed entries. That would also make it easier to debug bridges while working on them. If I want to know the value of a variable, I could just throw it, refresh the page and there it is. Currently I have to create a dummy feed to output something. But that would also send it to potential rss readers which I wouldn't want - also because many readers don't support deleting individual items which results in a messy feed.One neat way to handle different errors would be to introduce some exception classes that get handled accordingly. Like:
InvalidInputException
if one of the inputs has an unexpected format, which would send a 400 status code, andFeedException
if a feed cannot be created successfully, which would send a 500 status code. Any other Exception and Error should do something similar.Now, how could debugging values work? I'm not sure if there should be something like a
DebugException
. It might make more sense if debugging was handled via a return value that's different from the return value that creates a feed (EDIT: I forgot, it's not a return value but a property on the bridge class. But there could be adebug
property that'snull
by default and its value could be displayed if it's notnull
.).But exceptions make debugging values e.g. inside callback functions easier. And I think it'd also be a little easier to implement it through an exception.(EDIT: That actually not try anymore for class properties)What do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions