Liste des Groupes | Revenir à cl c |
Bonita Montero <Bonita.Montero@gmail.com> writes:Exactly. If an allocation failed in some of my older server code, 20 years ago for sure. Well, it would make the server go into a sort of "panic mode" and dump cache, dump timed out connections, ect, then it would try the allocation again. If that failed, it would go into shit hit the fan mode... ;^)Am 07.06.2025 um 23:12 schrieb Janis Papanagnou:Actually it very much matters where the allocation failed, if
>Context, in the general case, matters. ...>
If you need the context then you catch the exception near where
it is thrown; but that's not usual, meaning in most cases you
don't need that context. F.e. when a bad_alloc is thown it dosn't
matter which allocation failed, it's just enough to know that a
memory-collapse happened.
one wishes to recover from it.
It seems your concept of error
handling is simply reporting it (hopefully with sufficient
context information for the user to understand what needs to
be fixed) and calling exit().
Les messages affichés proviennent d'usenet.