Class RuntimeError
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
Exception that corresponds to Python/NumPy's RuntimeError. Raised when an error is detected that does not fall into any of the other categories.
public class RuntimeError : NumSharpException, ISerializable, INumSharpException
- Inheritance
-
RuntimeError
- Implements
- Derived
- Inherited Members
Remarks
Mirrors Python's RuntimeError for API compatibility. Common cases:
- np.cov: "cannot handle multidimensional fweights"
- np.cov: "incompatible numbers of samples and fweights"
Python's subclasses derive from it here too: NotImplementedError and TooHardError, so
a catch (RuntimeError) catches them as except RuntimeError does.
Constructors
RuntimeError()
Creates the error with Python's text for a bare raise RuntimeError: an empty
Message, as str(RuntimeError()) is ''.
public RuntimeError()
Remarks
ToString() then starts with the class name alone, as Python's traceback prints a
bare RuntimeError.
RuntimeError(string)
Creates the error with NumPy's (or the port's) message.
public RuntimeError(string message)
Parameters
messagestringThe text, verbatim: Python's
str()of the error.
RuntimeError(string, Exception)
Creates the error with a message and the exception that caused it: Python's raise RuntimeError(message)
from innerException, the cause kept in InnerException as Python keeps it in
cause.
public RuntimeError(string message, Exception innerException)