Skip to content
Lars Kristian Dahl edited this page Feb 15, 2016 · 3 revisions

The exception handling is slightly different between the synchronous and asynchronous methods.

General information

The actual exceptions thrown (directly or inside AggregateException) always inherits from EveLibException. If any other exception is thrown, that is a bug and should be reported. Most exceptions will inherit from EveLibWebException, which indicates there was an error when performing the web request. All EveLibWebExceptions have a property WebException, which contains the responsible WebException. Most modules throw EveLibWebException directly, unless otherwise is stated. (Currently EveXml and EveCrest throw more specific exceptions).

Synchronous

Because the synchronous methods use sync over async, they can throw multiple exceptions. This is handled by wrapping all exceptions in an AggregateException, which has a list, InnerExceptions, of all Exceptions that has been thrown. When using the synchronous methods, you need to catch AggregateException, and then check the inner exceptions.

Asynchronous

When using async/await, the AggregateException is unwrapped and only the first inner exception is thrown. The AggregateException is available through the Exception property on the Task that is awaited. Catch InvalidRequestException or any other specific exception, like normal, and check the Exception on the Task if you need to handle more than the first. For examples of handling AggregateException, see http://msdn.microsoft.com/en-us/library/dd537614(v=vs.110).aspx

Clone this wiki locally