Class ExceptionManager
This class handles the conversion between RobApi HRESULTS and .NET PC SDK exceptions. It is a utility class and can not be instantiated.
Inheritance
Namespace: ABB.Robotics
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public sealed class ExceptionManager
Methods
Create(Exception)
Generates a public exception that corresponds to the provided internal exception.
Declaration
public static Exception Create(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception |
Returns
Type | Description |
---|---|
System.Exception |
Remarks
If exception is an System.AggregateException, the innermost exception is used as basis for the created exception.
Create(Int32)
Generates a public exception that corresponds to the provided error code.
Declaration
public static Exception Create(int hresult)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hresult | The hresult to create an exception for. |
Returns
Type | Description |
---|---|
System.Exception |
Create(Int32, Exception)
Generates a public exception that corresponds to the provided error code and internal exception.
Declaration
public static Exception Create(int hresult, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hresult | The hresult to create an exception for. |
System.Exception | exception | The original exception |
Returns
Type | Description |
---|---|
System.Exception |
Remarks
If exception is an System.AggregateException, the innermost exception and its hresult is used as basis for the created exception.
Create(UInt32)
Generates a public exception that corresponds to the provided error code.
Declaration
[CLSCompliant(false)]
public static Exception Create(uint hresult)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | hresult | The hresult to create an exception for. |
Returns
Type | Description |
---|---|
System.Exception |
Create(UInt32, Exception)
Generates a public exception that corresponds to the provided error code and internal exception.
Declaration
[CLSCompliant(false)]
public static Exception Create(uint hresult, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | hresult | The hresult to create an exception for. |
System.Exception | exception | The original exception |
Returns
Type | Description |
---|---|
System.Exception |
Remarks
If exception is an System.AggregateException, the innermost exception and its hresult is used as basis for the created exception.
CreateLastW32()
Creates a new W32 exception with GetLastError() as inparameter for the constructor.
Declaration
public static Exception CreateLastW32()
Returns
Type | Description |
---|---|
System.Exception | W32Exception object. |
Failed(Int32)
True if the hresult is an failure code.
Declaration
public static bool Failed(int hresult)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hresult | The hresult to verify. |
Returns
Type | Description |
---|---|
System.Boolean | True if the code is an error code. |
Failed(UInt32)
True if the hresult is an failure code.
Declaration
[CLSCompliant(false)]
public static bool Failed(uint hresult)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | hresult | The hresult to verify. |
Returns
Type | Description |
---|---|
System.Boolean | True if the code is an error code. |
Succeeded(Int32)
\Returns true if the hresult is a success code.
Declaration
public static bool Succeeded(int hresult)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | hresult | The hresult to verify. |
Returns
Type | Description |
---|---|
System.Boolean | True if the code is a success code. |
Succeeded(UInt32)
\Returns true if the hresult is a success code.
Declaration
[CLSCompliant(false)]
public static bool Succeeded(uint hresult)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | hresult | The hresult to verify. |
Returns
Type | Description |
---|---|
System.Boolean | True if the code is a success code. |