ErrorBase

class wpilib.ErrorBase(self: wpilib.ErrorBase) → None

Bases: pybind11_builtins.pybind11_object

Base class for most objects.

ErrorBase is the base class for most objects since it holds the generated error for that object. In addition, there is a single instance of a global error object.

clearError(self: wpilib.ErrorBase) → None

Clear the current error information associated with this sensor.

clearGlobalErrors(self: wpilib.ErrorBase) → None

Clear global errors.

cloneError(self: wpilib.ErrorBase, rhs: wpilib.ErrorBase) → None
getError(*args, **kwargs)

Overloaded function.

  1. getError(self: wpilib._wpilib.ErrorBase) -> wpilib._wpilib.Error

Retrieve the current error.

Get the current error information associated with this sensor.

  1. getError(self: wpilib._wpilib.ErrorBase) -> wpilib._wpilib.Error

Retrieve the current error.

Get the current error information associated with this sensor.

static getGlobalError()wpilib.Error

Retrieve the last global error.

static getGlobalErrors() → List[wpilib.Error]

Retrieve all global errors.

setErrnoError(self: wpilib.ErrorBase, contextMessage: str, filename: str, function: str, lineNumber: int) → None

Set error information associated with a C library call that set an error to the “errno” global variable.

Parameters
  • contextMessage – A custom message from the code that set the error.

  • filename – Filename of the error source

  • function – Function of the error source

  • lineNumber – Line number of the error source

setError(self: wpilib.ErrorBase, code: int, contextMessage: str, filename: str, function: str, lineNumber: int) → None

Set the current error information associated with this sensor.

Parameters
  • code – The error code

  • contextMessage – A custom message from the code that set the error.

  • filename – Filename of the error source

  • function – Function of the error source

  • lineNumber – Line number of the error source

setErrorRange(self: wpilib.ErrorBase, code: int, minRange: int, maxRange: int, requestedValue: int, contextMessage: str, filename: str, function: str, lineNumber: int) → None

Set the current error information associated with this sensor. Range versions use for initialization code.

Parameters
  • code – The error code

  • minRange – The minimum allowed allocation range

  • maxRange – The maximum allowed allocation range

  • requestedValue – The requested value to allocate

  • contextMessage – A custom message from the code that set the error.

  • filename – Filename of the error source

  • function – Function of the error source

  • lineNumber – Line number of the error source

static setGlobalError(code: int, contextMessage: str, filename: str, function: str, lineNumber: int) → None
static setGlobalWPIError(errorMessage: str, contextMessage: str, filename: str, function: str, lineNumber: int) → None
setImaqError(self: wpilib.ErrorBase, success: int, contextMessage: str, filename: str, function: str, lineNumber: int) → None

Set the current error information associated from the nivision Imaq API.

Parameters
  • success – The return from the function

  • contextMessage – A custom message from the code that set the error.

  • filename – Filename of the error source

  • function – Function of the error source

  • lineNumber – Line number of the error source

setWPIError(self: wpilib.ErrorBase, errorMessage: str, code: int, contextMessage: str, filename: str, function: str, lineNumber: int) → None

Set the current error information associated with this sensor.

Parameters
  • errorMessage – The error message from WPIErrors.h

  • contextMessage – A custom message from the code that set the error.

  • filename – Filename of the error source

  • function – Function of the error source

  • lineNumber – Line number of the error source

statusIsFatal(self: wpilib.ErrorBase) → bool

Check if the current error code represents a fatal error.

Returns

true if the current error is fatal.