NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
862 stars 170 forks source link

Add return value to static void LogException #28

Closed dziedrius closed 11 years ago

dziedrius commented 11 years ago

Currently LogException does not return any value, but I think it would be useful if it would return Error instance. Consider following scenario - I wish to include error hash in error page, in case client would contact our support, he could provide that hash and we could use it to find concrete error. I could make workaround and add to custom data own calculated hash when calling LogException, but that would be calculating hash twice, as long as it would cost practically nothing to return error as a result, I would prefer this way :)

NickCraver commented 11 years ago

I'm not opposed to this...almost did it once, but what should return when the error is not logged?

For instance when a regex or type ignore is met, nothing is logged...or if there's an error with the actual logging (hopefully that's crazy rare). Would you expect null in these cases?

dziedrius commented 11 years ago

I think null would be fair in such cases.