EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UserError Class Reference

Python object "ccp_exceptions.UserError". More...

#include "PyExceptions.h"

Inheritance diagram for UserError:
Collaboration diagram for UserError:

Public Member Functions

 UserError (const char *exceptionType)
 
UserErrorAddFormatValue (const char *name, PyRep *value)
 Fluent version of the protected AddKeyword, allows for adding a keyword to the exception. More...
 
UserErrorAddDateTime (const char *name, time_t date)
 Shorthand method for adding the given date-time as a datetime string in the message. More...
 
UserErrorAddDate (const char *name, time_t date)
 Shorthand method for adding the given date time as a date string in the message. More...
 
UserErrorAddTime (const char *name, time_t time)
 Shorthand method for adding the given date time as a time string in the message. More...
 
UserErrorAddTimeShort (const char *name, time_t time)
 Shorthand method for adding the given time as a time string in the message (without minutes) More...
 
UserErrorAddA (const char *name, const char *value)
 Shorthand method for adding "a" before the beginning of the value. More...
 
UserErrorAddThe (const char *name, const char *value)
 Shorthand method for adding "the" before the beginning of the value. More...
 
UserErrorAddUELocalization (const char *name, const char *strKey, PyDict *args=nullptr)
 Shorthand method for adding a string in the client's translations. More...
 
UserErrorAddList (const char *name, PyList *listEntries, const char *separator=nullptr)
 Shorthand method for adding a list of format parameters. More...
 
UserErrorAddOwnerName (const char *name, uint32 ownerID)
 Shorthand method for adding an owner's name. More...
 
UserErrorAddOwnerNick (const char *name, uint32 ownerID)
 Shorthand method for adding an owner's nick (first name without surname) More...
 
UserErrorAddLocationName (const char *name, uint32 locationID)
 Shorthand method for adding a location's name. More...
 
UserErrorAddTypeName (const char *name, uint32 typeID)
 Shorthand method for adding a type's name. More...
 
UserErrorAddTypeDescription (const char *name, uint32 typeID)
 Shorthand method for adding a type's description. More...
 
UserErrorAddTypeList (const char *name, PyList *typeIDs)
 Shorthand method for adding a list of types' names. More...
 
UserErrorAddBlueprintTypeName (const char *name, uint32 bpTypeID)
 Shorthand method for adding a blueprint's type name. More...
 
UserErrorAddGroupName (const char *name, uint32 groupID)
 Shorthand method for adding a group's name. More...
 
UserErrorAddGroupDescription (const char *name, uint32 groupID)
 Shorthand method for adding a group's description. More...
 
UserErrorAddCategoryName (const char *name, uint32 categoryID)
 Shorthand method for adding a category's name. More...
 
UserErrorAddCategoryDescription (const char *name, uint32 categoryID)
 Shorthand method for adding a category's description. More...
 
UserErrorAddAmount (const char *name, int quantity)
 Shorthand method for adding a quantity value. More...
 
UserErrorAddAmount (const char *name, uint quantity)
 Shorthand method for adding a quantity value. More...
 
UserErrorAddAmount (const char *name, double quantity)
 Shorthand method for adding a quantity value. More...
 
UserErrorAddISK (const char *name, double isk)
 Shorthand method for adding an ISK amount. More...
 
UserErrorAddAUR (const char *name, double aur)
 Shorthand method for adding an AUR amount. More...
 
UserErrorAddDistance (const char *name, double distance)
 Shorthand method for adding distance in a easy to read unit. More...
 
UserErrorAddTypeIDAndQuantity (const char *name, uint32 typeID, int quantity)
 Shorthand method for adding type ID and quantity. More...
 
- Public Member Functions inherited from PyException
 PyException (PyRep *except)
 
 PyException (const PyException &oth)
 
 ~PyException ()
 
PyExceptionoperator= (const PyException &oth)
 

Protected Member Functions

void AddKeyword (const char *name, PyRep *value)
 Adds keyword to exception. More...
 
UserErrorAddParameterKeyword (const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
 Adds a keyword to exception. More...
 
PyDict_GetTupleKeywords () const
 
PyDict_GetDictKeywords () const
 
PyTuple_CreateArgs (const char *msg)
 
PyDict_CreateKeywords (const char *msg)
 

Protected Attributes

PyTuplem_args
 
PyDictm_keywords
 

Static Protected Attributes

static const char * EXCEPTION_NAME = "ccp_exceptions.UserError"
 

Additional Inherited Members

- Public Attributes inherited from PyException
PyRepssException
 

Detailed Description

Python object "ccp_exceptions.UserError".

This exception can be used for various errors.

Author
Bloody.Rabbit

Definition at line 121 of file PyExceptions.h.

Constructor & Destructor Documentation

UserError::UserError ( const char *  exceptionType)

Definition at line 97 of file PyExceptions.cpp.

98 : PyException (new PyObjectEx_Type1 (new PyToken (EXCEPTION_NAME), _CreateArgs (exceptionType), _CreateKeywords (exceptionType)))
99 {
100 }
PyTuple * _CreateArgs(const char *msg)
PyException(PyRep *except)
Python token (eg. class name).
Definition: PyRep.h:522
Wrapper class for PyObjectEx of type 1.
Definition: PyRep.h:911
PyDict * _CreateKeywords(const char *msg)
static const char * EXCEPTION_NAME
Definition: PyExceptions.h:413

Member Function Documentation

PyTuple * UserError::_CreateArgs ( const char *  msg)
protected

Definition at line 274 of file PyExceptions.cpp.

References m_args, and PyTuple::SetItem().

275 {
276  this->m_args = new PyTuple (2);
277 
278  this->m_args->SetItem (0, new PyString (msg));
279  this->m_args->SetItem (1, new PyDict);
280 
281  return this->m_args;
282 }
Python string.
Definition: PyRep.h:430
Python's dictionary.
Definition: PyRep.h:719
Python tuple.
Definition: PyRep.h:567
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
PyTuple * m_args
Definition: PyExceptions.h:443

Here is the call graph for this function:

PyDict * UserError::_CreateKeywords ( const char *  msg)
protected

Definition at line 284 of file PyExceptions.cpp.

References m_keywords, and PyDict::SetItemString().

285 {
286  this->m_keywords = new PyDict;
287 
288  this->m_keywords->SetItemString ("msg", new PyString (msg));
289  this->m_keywords->SetItemString ("dict", new PyDict);
290 
291  return this->m_keywords;
292 }
Python string.
Definition: PyRep.h:430
Python's dictionary.
Definition: PyRep.h:719
PyDict * m_keywords
Definition: PyExceptions.h:444
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812

Here is the call graph for this function:

PyDict * UserError::_GetDictKeywords ( ) const
protected

Definition at line 269 of file PyExceptions.cpp.

References PyRep::AsDict(), PyDict::GetItemString(), and m_keywords.

Referenced by AddKeyword().

270 {
271  return this->m_keywords->GetItemString ("dict")->AsDict ();
272 }
PyRep * GetItemString(const char *key) const
Obtains database entry based on given key string.
Definition: PyRep.cpp:702
PyDict * AsDict()
Definition: PyRep.h:142
PyDict * m_keywords
Definition: PyExceptions.h:444

Here is the call graph for this function:

Here is the caller graph for this function:

PyDict * UserError::_GetTupleKeywords ( ) const
protected

Definition at line 264 of file PyExceptions.cpp.

References PyRep::AsDict(), PyTuple::GetItem(), and m_args.

Referenced by AddKeyword().

265 {
266  return this->m_args->GetItem (1)->AsDict();
267 }
PyRep * GetItem(size_t index) const
Returns Python object.
Definition: PyRep.h:602
PyDict * AsDict()
Definition: PyRep.h:142
PyTuple * m_args
Definition: PyExceptions.h:443

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddA ( const char *  name,
const char *  value 
)

Shorthand method for adding "a" before the beginning of the value.

Specially useful for things like "you need a Shield hardener" type of messages

Parameters
[in]nameThe parameter
[in]valueThe value to display after "a/an"
Returns
self

Definition at line 141 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_A.

142 {
143  return this->AddParameterKeyword (name, UserError_Parameter_A, new PyString (value));
144 }
Python string.
Definition: PyRep.h:430
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddAmount ( const char *  name,
int  quantity 
)

Shorthand method for adding a quantity value.

Parameters
[in]nameThe parameter
[in]quantityThe quantity for the client to format
Returns
self

Definition at line 219 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Amount.

Referenced by StructureSE::Activate(), RamMethods::JobsCheck(), and Inventory::ValidateAddItem().

220 {
221  return this->AddParameterKeyword (name, UserError_Parameter_Amount, new PyInt (quantity));
222 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddAmount ( const char *  name,
uint  quantity 
)

Shorthand method for adding a quantity value.

Parameters
[in]nameThe parameter
[in]quantityThe quantity for the client to format
Returns
self

Definition at line 224 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Amount.

225 {
226  return this->AddParameterKeyword (name, UserError_Parameter_Amount, new PyInt (quantity));
227 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddAmount ( const char *  name,
double  quantity 
)

Shorthand method for adding a quantity value.

Parameters
[in]nameThe parameter
[in]amountThe quantity for the client to format
Returns
self

Definition at line 229 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Amount.

230 {
231  return this->AddParameterKeyword (name, UserError_Parameter_Amount, new PyFloat (quantity));
232 }
Python floating point number.
Definition: PyRep.h:292
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddAUR ( const char *  name,
double  aur 
)

Shorthand method for adding an AUR amount.

Parameters
[in]nameThe parameter
[in]aurThe AUR quantity for the client to format
Returns
self

Definition at line 239 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_AUR.

240 {
241  return this->AddParameterKeyword (name, UserError_Parameter_AUR, new PyFloat (aur));
242 }
Python floating point number.
Definition: PyRep.h:292
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddBlueprintTypeName ( const char *  name,
uint32  bpTypeID 
)

Shorthand method for adding a blueprint's type name.

Parameters
[in]nameThe parameter
[in]typeIDThe blueprint's type ID
Returns
self

Definition at line 194 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_BluePrintTypeName.

195 {
196  return this->AddParameterKeyword (name, UserError_Parameter_BluePrintTypeName, new PyInt (bpTypeID));
197 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddCategoryDescription ( const char *  name,
uint32  categoryID 
)

Shorthand method for adding a category's description.

Parameters
[in]nameThe parameter
[in]typeIDThe category's ID
Returns
self

Definition at line 214 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_CategoryDescription.

215 {
216  return this->AddParameterKeyword (name, UserError_Parameter_CategoryDescription, new PyInt (categoryID));
217 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddCategoryName ( const char *  name,
uint32  categoryID 
)

Shorthand method for adding a category's name.

Parameters
[in]nameThe parameter
[in]typeIDThe category's ID
Returns
self

Definition at line 209 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_CategoryName.

210 {
211  return this->AddParameterKeyword (name, UserError_Parameter_CategoryName, new PyInt (categoryID));
212 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddDate ( const char *  name,
time_t  date 
)

Shorthand method for adding the given date time as a date string in the message.

Parameters
[in]nameThe parameter
[in]dateThe date in win32 epoch format
Returns
self

Definition at line 127 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Date.

128 {
129  return this->AddParameterKeyword (name, UserError_Parameter_Date, new PyLong (date));
130 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

UserError & UserError::AddDateTime ( const char *  name,
time_t  date 
)

Shorthand method for adding the given date-time as a datetime string in the message.

Parameters
[in]nameThe parameter
[in]dateThe date in win32 epoch format
Returns
self

Definition at line 122 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_DateTime.

123 {
124  return this->AddParameterKeyword (name, UserError_Parameter_DateTime, new PyLong (date));
125 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

UserError & UserError::AddDistance ( const char *  name,
double  distance 
)

Shorthand method for adding distance in a easy to read unit.

Parameters
[in]nameThe parameter
[in]distanceThe distance for the client to format (in meters)
Returns
self

Definition at line 244 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Distance.

245 {
246  return this->AddParameterKeyword (name, UserError_Parameter_Distance, new PyFloat (distance));
247 }
Python floating point number.
Definition: PyRep.h:292
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddFormatValue ( const char *  name,
PyRep value 
)

Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.

Keywords are simple parameters used to replace a specific part of the message string. These parameters are defined in the string itself in the form of %(name)s

Parameters
[in]nameThe parameter
[in]valueThe value
Returns
self

Definition at line 102 of file PyExceptions.cpp.

References AddKeyword().

Referenced by StructureSE::Activate(), AddParameterKeyword(), ActiveModule::CanActivate(), CustomError::CustomError(), CommandDispatcher::Execute(), MarketMgr::ExecuteBuyOrder(), AccountService::HandleCorpTransaction(), ShipItem::LoadCharge(), RamMethods::MaterialSkillsCheck(), RamMethods::ProductionTimeCheck(), ShipItem::TryModuleLimitChecks(), and Inventory::ValidateAddItem().

103 {
104  this->AddKeyword (name, value);
105 
106  return *this;
107 }
void AddKeyword(const char *name, PyRep *value)
Adds keyword to exception.

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddGroupDescription ( const char *  name,
uint32  groupID 
)

Shorthand method for adding a group's description.

Parameters
[in]nameThe parameter
[in]typeIDThe group's ID
Returns
self

Definition at line 204 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_GroupDescription.

205 {
206  return this->AddParameterKeyword (name, UserError_Parameter_GroupDescription, new PyInt (groupID));
207 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddGroupName ( const char *  name,
uint32  groupID 
)

Shorthand method for adding a group's name.

Parameters
[in]nameThe parameter
[in]typeIDThe group's ID
Returns
self

Definition at line 199 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_GroupName.

200 {
201  return this->AddParameterKeyword (name, UserError_Parameter_GroupName, new PyInt (groupID));
202 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddISK ( const char *  name,
double  isk 
)

Shorthand method for adding an ISK amount.

Parameters
[in]nameThe parameter
[in]iskThe ISK quantity for the client to format
Returns
self

Definition at line 234 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_ISK.

Referenced by Character::AlterBalance(), and AccountService::HandleCorpTransaction().

235 {
236  return this->AddParameterKeyword (name, UserError_Parameter_ISK, new PyFloat (isk));
237 }
Python floating point number.
Definition: PyRep.h:292
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

Here is the caller graph for this function:

void UserError::AddKeyword ( const char *  name,
PyRep value 
)
protected

Adds keyword to exception.

Parameters
[in]nameThe keyword.
[in]valueValue to be associated with the keyword.

Definition at line 254 of file PyExceptions.cpp.

References _GetDictKeywords(), _GetTupleKeywords(), PyIncRef, and PyDict::SetItemString().

Referenced by AddFormatValue().

255 {
256  // We need 2 refs ... the first one is given to us,
257  // but we must create the second one ...
258  PyIncRef( value );
259 
260  _GetTupleKeywords()->SetItemString( name, value );
261  _GetDictKeywords()->SetItemString( name, value );
262 }
PyDict * _GetDictKeywords() const
PyDict * _GetTupleKeywords() const
#define PyIncRef(op)
Definition: PyRep.h:56
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddList ( const char *  name,
PyList listEntries,
const char *  separator = nullptr 
)

Shorthand method for adding a list of format parameters.

TODO: OFFER A WAY OF GENERATING listEntries AS THAT CAN ALSO HAVE FORMAT PARAMETERS LIKE THE USERERROR CLASS

Parameters
[in]nameThe parameter
[in]listEntriesThe list of data to concatenate
[in]separatorThe separator to use (if any), uses the language's default if not specified
Returns
self

Definition at line 156 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_List.

157 {
158  if (separator == nullptr)
159  return this->AddParameterKeyword (name, UserError_Parameter_List, listEntries);
160  else
161  return this->AddParameterKeyword (name, UserError_Parameter_List, listEntries, new PyString (separator));
162 }
Python string.
Definition: PyRep.h:430
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddLocationName ( const char *  name,
uint32  locationID 
)

Shorthand method for adding a location's name.

Parameters
[in]nameThe parameter
[in]locationIDThe location's ID
Returns
self

Definition at line 174 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_LocationName.

Referenced by RamMethods::ItemLocationCheck(), and Inventory::ValidateAddItem().

175 {
176  return this->AddParameterKeyword (name, UserError_Parameter_LocationName, new PyLong (locationID));
177 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddOwnerName ( const char *  name,
uint32  ownerID 
)

Shorthand method for adding an owner's name.

Parameters
[in]nameThe parameter
[in]ownerIDThe owner's ID
Returns
self

Definition at line 164 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_OwnerName.

Referenced by AccountService::HandleCorpTransaction().

165 {
166  return this->AddParameterKeyword (name, UserError_Parameter_OwnerName, new PyLong (ownerID));
167 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddOwnerNick ( const char *  name,
uint32  ownerID 
)

Shorthand method for adding an owner's nick (first name without surname)

Parameters
[in]nameThe parameter
[in]ownerIDThe owner's ID
Returns
self

Definition at line 169 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_OwnerNick.

170 {
171  return this->AddParameterKeyword (name, UserError_Parameter_OwnerNick, new PyLong (ownerID));
172 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

UserError & UserError::AddParameterKeyword ( const char *  name,
UserError_ParameterIDs  type,
PyRep value,
PyRep value2 = nullptr 
)
protected

Adds a keyword to exception.

Shorthand method for any of the Add* values

Parameters
[in]nameThe keyword
[in]typeType of parameter to send
[in]valueThe parameter's value
[in]value2The second value (if present)
Returns
self

Definition at line 109 of file PyExceptions.cpp.

References AddFormatValue(), and PyTuple::SetItem().

Referenced by AddA(), AddAmount(), AddAUR(), AddBlueprintTypeName(), AddCategoryDescription(), AddCategoryName(), AddDate(), AddDateTime(), AddDistance(), AddGroupDescription(), AddGroupName(), AddISK(), AddList(), AddLocationName(), AddOwnerName(), AddOwnerNick(), AddThe(), AddTime(), AddTimeShort(), AddTypeDescription(), AddTypeIDAndQuantity(), AddTypeList(), AddTypeName(), and AddUELocalization().

110 {
111  PyTuple* param = new PyTuple (value2 == nullptr ? 2 : 3);
112 
113  param->SetItem (0, new PyInt (type));
114  param->SetItem (1, value);
115 
116  if (value2 != nullptr)
117  param->SetItem (2, value2);
118 
119  return this->AddFormatValue (name, param);
120 }
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
Python tuple.
Definition: PyRep.h:567
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddThe ( const char *  name,
const char *  value 
)

Shorthand method for adding "the" before the beginning of the value.

Parameters
[in]nameThe parameter
[in]valueThe value to display after "the"
Returns
self

Definition at line 146 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_The.

147 {
148  return this->AddParameterKeyword (name, UserError_Parameter_The, new PyString (value));
149 }
Python string.
Definition: PyRep.h:430
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddTime ( const char *  name,
time_t  time 
)

Shorthand method for adding the given date time as a time string in the message.

Parameters
[in]nameThe parameter
[in]timeThe date in win32 epoch format
Returns
self

Definition at line 132 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Time.

133 {
134  return this->AddParameterKeyword (name, UserError_Parameter_Time, new PyLong (time));
135 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

UserError & UserError::AddTimeShort ( const char *  name,
time_t  time 
)

Shorthand method for adding the given time as a time string in the message (without minutes)

Specially useful when displaying time lapses (like time left for something)

Parameters
[in]nameThe parameter
[in]timeThe date in win32 epoch format
Returns
self

Definition at line 137 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_TimeShort.

138 {
139  return this->AddParameterKeyword (name, UserError_Parameter_TimeShort, new PyLong (time));
140 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

UserError & UserError::AddTypeDescription ( const char *  name,
uint32  typeID 
)

Shorthand method for adding a type's description.

Parameters
[in]nameThe parameter
[in]typeIDThe type's ID
Returns
self

Definition at line 184 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_TypeDescription.

185 {
186  return this->AddParameterKeyword (name, UserError_Parameter_TypeDescription, new PyInt (typeID));
187 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddTypeIDAndQuantity ( const char *  name,
uint32  typeID,
int  quantity 
)

Shorthand method for adding type ID and quantity.

Parameters
[in]nameThe parameter
[in]typeIDThe type's ID
[in]quantityThe quantity
Returns
self

Definition at line 249 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_TypeIDAndQuantity.

250 {
251  return this->AddParameterKeyword (name, UserError_Parameter_TypeIDAndQuantity, new PyInt (typeID), new PyInt (quantity));
252 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

UserError & UserError::AddTypeList ( const char *  name,
PyList typeIDs 
)

Shorthand method for adding a list of types' names.

Parameters
[in]nameThe parameter
[in]typeIDsThe list of type ids
Returns
self

Definition at line 189 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_TypeIDList.

190 {
191  return this->AddParameterKeyword (name, UserError_Parameter_TypeIDList, typeIDs);
192 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

UserError & UserError::AddTypeName ( const char *  name,
uint32  typeID 
)

Shorthand method for adding a type's name.

Parameters
[in]nameThe parameter
[in]typeIDThe type's ID
Returns
self

Definition at line 179 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_TypeName.

Referenced by ReprocessingServiceBound::GetQuote(), ModuleManager::Online(), and ShipItem::TryModuleLimitChecks().

180 {
181  return this->AddParameterKeyword (name, UserError_Parameter_TypeName, new PyInt (typeID));
182 }
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

Here is the caller graph for this function:

UserError & UserError::AddUELocalization ( const char *  name,
const char *  strKey,
PyDict args = nullptr 
)

Shorthand method for adding a string in the client's translations.

Parameters
[in]nameThe parameter
[in]strKeyThe name of the extra MLS string to lookup
[in]formatThe extra format to apply if any
Returns
self

Definition at line 151 of file PyExceptions.cpp.

References AddParameterKeyword(), and UserError_Parameter_Localization.

152 {
153  return this->AddParameterKeyword (name, UserError_Parameter_Localization, new PyString (strKey), args);
154 }
Python string.
Definition: PyRep.h:430
UserError & AddParameterKeyword(const char *name, UserError_ParameterIDs type, PyRep *value, PyRep *value2=nullptr)
Adds a keyword to exception.

Here is the call graph for this function:

Member Data Documentation

const char * UserError::EXCEPTION_NAME = "ccp_exceptions.UserError"
staticprotected

The name of the exception for EVE

Definition at line 413 of file PyExceptions.h.

PyTuple* UserError::m_args
protected

Definition at line 443 of file PyExceptions.h.

Referenced by _CreateArgs(), and _GetTupleKeywords().

PyDict* UserError::m_keywords
protected

Definition at line 444 of file PyExceptions.h.

Referenced by _CreateKeywords(), and _GetDictKeywords().


The documentation for this class was generated from the following files: