Tag Info

New answers tagged

0

Its a reasonably common practice - C programs (and other systems, eg errno) often to store the last error in a location so you can pick the details out if a function returned an error code. There's no reason why you can't do the same. However, if you do this you have to take a few things into consideration. Threads are very important, each error info must ...


0

I'm afraid you need to code the retrying logic yourself. However, this can be separated from the actual service call by utilizing the Proxy pattern. The RetryingProxy wraps the actual service and implements the error handling and retrying policy you need.


0

Have you looked into Aspect oriented programming ? https://en.wikipedia.org/wiki/Aspect-oriented_programming Maybe it helps ? An other idea would be to use an abstract factory to return the concrete implementation that you need to handle the error on runtime.


1

There are several things to consider here. It is worth reading up on the HTTP specification, specifically about idempotent rules, and to also consider a RESTful style of webservice interface. In short, if you implement a webservice with GET or HEAD, then in theory it should be safe to call multiple times with the same parameters, but webservices that are ...


1

What language are you using? Depending on the language(synchronious, asynchronious) you will have different solutions. If it is JavaScript, promise is indeed the way to go. Promises in JavaScript If it is something like C#, you probably don't want to have a loop like you indicated, because you will be blocking the thread. In that scenario, I would look ...


2

Collecting exceptions When collecting exceptions, be careful with two things: What will happen if an exception occurs, and while reporting it, the reporting mechanism throws another exception? The worst case is to start reporting the new exception, which may trigger a new one, resulting in thousands of new exceptions thrown in a loop. You absolutely need ...


0

I have no detailed solution for this but my approach would be to make sub classes of the exceptions you catch and store + analyse and implement some information about the exception type. public enum ExceptionDanger { Low, Middle, SecurityCritical // And so on } Now we add this to the derived exception class: public class ...



Top 50 recent answers are included