-
-
Notifications
You must be signed in to change notification settings - Fork 426
Remove a catch of Throwable in object.d #1743
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/object.d
Outdated
@@ -1737,7 +1728,7 @@ class Throwable : Object | |||
sink("\n"); sink(t); | |||
} | |||
} | |||
catch (Throwable) | |||
catch (Exception) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it even at any time a good idea to silently catch Exceptions? It seems to me a bit suspicious that toString
doesn't expose the nothrow
guarantee publicly, but in the other hand does this silent catching..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception
implies that the program is still in a recoverable state. Error
s imply some unrecoverable state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know, but I was trying to say that silently swallowing them as it is done in the existing code isn't really a good practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok :)
Had to remove the second change as it's error-ing and I don't have time to debug right now. |
Pinging people with merge rights |
src/object.d
Outdated
return cast(size_t)cast(void*)this; | ||
} | ||
auto data = this.toString(); | ||
return hashOf(data, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that it was like this before, but is there any reason to create a variable here? It seems like a pointless extra line.
@jmdavis Fixed |
Just wasted time looking at this, because github doesn't send me notifications of labels being added. Grrr... |
|
Catching
Throwable
is a bad idea most of the time.In the second case, there's no obvious reason why we would want to catchError
s from user code generated by theTraceInfo.opApply