osslate / irc-message

Performant, streaming IRC message parser
BSD 2-Clause "Simplified" License
92 stars 13 forks source link

Don't always Throw errors. #7

Closed rickihastings closed 10 years ago

rickihastings commented 10 years ago

Allow the option to be set somewhere to just return false or null instead of throwing errors.

osslate commented 10 years ago

Due to the nature of irc-message (it's designed as an object to be instantiated via new) this isn't really possible. If you have an idea as to an alternative way to handle parsing errors, shoot.

rickihastings commented 10 years ago

Maybe passing a boolean into it to determine whether to throw or return false.

On 6 Dec 2013, at 16:55, Fionn Kelleher notifications@github.com wrote:

Due to the nature of irc-message (it's designed as an object to be instantiated via new) this isn't really possible. If you have an idea as to an alternative way to handle parsing errors, shoot.

— Reply to this email directly or view it on GitHub.

osslate commented 10 years ago

I can't return false, only an object of some sort. I could probably

return new Boolean(false);
rickihastings commented 10 years ago

Actually yeah that's a bit horrible. Maybe just return a valid message object but with one param which is the line that was sent? Or something.

On 6 Dec 2013, at 20:25, Fionn Kelleher notifications@github.com wrote:

I can't return false, only an object of some sort. I could probably

return new Boolean(false); — Reply to this email directly or view it on GitHub.