Top Description Inners Fields Constructors Methods
org.python.core

pack-priv Class ArgumentError

extends Exception
Class Inheritance

The type of (non-Python) exception thrown by invoking a slot or method with the wrong pattern of arguments. An ArgumentError encapsulates what a particular method or slot expected by way of the number of positional arguments and the presence or otherwise of keyword arguments.

Having a distinct exception solves the problem that not all the context for an informative message may be in scope at discovery. ArgumentError should be caught as soon as the necessary context is available and converted to a Python exception.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv final short
pack-priv final short
pack-priv final ArgumentError.Mode
private static final long

Constructor Summary

AccessConstructor and Description
private
ArgumentError(ArgumentError.Mode mode, int minArgs, int maxArgs)

pack-priv
ArgumentError(ArgumentError.Mode
qualifies the sub-type of the problem
mode
)

The mode is Mode#NOARGS or Mode#NOKWARGS.

pack-priv
ArgumentError(int
expected number of arguments
numArgs
)

The mode is Mode#NUMARGS or Mode#NOARGS.

pack-priv
ArgumentError(int
minimum expected number of arguments
minArgs
,
int
maximum expected number of arguments
maxArgs
)

The mode is Mode#MINMAXARGS, Mode#NUMARGS or Mode#NOARGS.

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this throwable.

Field Detail

maxArgsback to summary
pack-priv final short maxArgs
minArgsback to summary
pack-priv final short minArgs
modeback to summary
pack-priv final ArgumentError.Mode mode
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Constructor Detail

ArgumentErrorback to summary
private ArgumentError(ArgumentError.Mode mode, int minArgs, int maxArgs)
ArgumentErrorback to summary
pack-priv ArgumentError(ArgumentError.Mode mode)

The mode is Mode#NOARGS or Mode#NOKWARGS. In the latter case, minArgs and maxArgs should be ignored.

Parameters
mode:ArgumentError.Mode

qualifies the sub-type of the problem

ArgumentErrorback to summary
pack-priv ArgumentError(int numArgs)

The mode is Mode#NUMARGS or Mode#NOARGS.

Parameters
numArgs:int

expected number of arguments

ArgumentErrorback to summary
pack-priv ArgumentError(int minArgs, int maxArgs)

The mode is Mode#MINMAXARGS, Mode#NUMARGS or Mode#NOARGS.

Parameters
minArgs:int

minimum expected number of arguments

maxArgs:int

maximum expected number of arguments

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Doc from java.lang.Throwable.toString.

Returns a short description of this throwable. The result is the concatenation of:

  • the name of the class of this object
  • ": " (a colon and a space)
  • the result of invoking this object's getLocalizedMessage method
If getLocalizedMessage returns null, then just the class name is returned.
Returns:String

a string representation of this throwable.

Annotations
@Override

org.python.core back to summary

pack-priv final Enum ArgumentError.Mode

extends Enum<ArgumentError.Mode>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ArgumentError.Mode
public static final ArgumentError.Mode
public static final ArgumentError.Mode
public static final ArgumentError.Mode
public static final ArgumentError.Mode

Constructor Summary

AccessConstructor and Description
private
Mode()

Method Summary

Modifier and TypeMethod and Description
pack-priv static ArgumentError.Mode

Returns:

a mode
choose
(int
minimum expected number of arguments
minArgs
,
int
maximum expected number of arguments
maxArgs
)

Choose a mode from NOARGS to MINMAXARGS based on the min and max argument numbers

public static ArgumentError.Mode
public static ArgumentError.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

MINMAXARGSback to summary
public static final ArgumentError.Mode MINMAXARGS
NOARGSback to summary
public static final ArgumentError.Mode NOARGS
NOKWARGSback to summary
public static final ArgumentError.Mode NOKWARGS
NUMARGSback to summary
public static final ArgumentError.Mode NUMARGS
SELFback to summary
public static final ArgumentError.Mode SELF

Constructor Detail

Modeback to summary
private Mode()

Method Detail

chooseback to summary
pack-priv static ArgumentError.Mode choose(int minArgs, int maxArgs)

Choose a mode from NOARGS to MINMAXARGS based on the min and max argument numbers

Parameters
minArgs:int

minimum expected number of arguments

maxArgs:int

maximum expected number of arguments

Returns:ArgumentError.Mode

a mode

valueOfback to summary
public static ArgumentError.Mode valueOf(String name)
valuesback to summary
public static ArgumentError.Mode[] values()