Functions/DarkRP/Shared/error

From Official DarkRP Wiki
Jump to navigation Jump to search
Function
Function name DarkRP.error(string message, number stack, table hints, string path, number line)
Description:
Throw a simplerr formatted error. Also halts the stack, which means that statements after calling this function will not execute.
Returns: boolean succeed, string msg
Part of Library: DarkRP
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Functions/DarkRP/Shared/error]DarkRP.error[/url][/b]

Function parameters

  1. message (string)
  2. The message of the error.

  3. stack (number) (optional)
  4. From which point in the function call stack to report the error. 1 to include the function that called DarkRP.error, 2 to exclude it, etc. The default value is 1.

  5. hints (table) (optional)
  6. Table containing hint strings. Use these hints to explain the error, describe possible causes or provide help to solve the problem.

  7. path (string) (optional)
  8. Override the path of the error. Will be shown in the error message. By default this is determined by the stack level.

  9. line (number) (optional)
  10. Override the line number of the error. By default this is determined by the stack level.


Function return values

  1. succeed (boolean)
  2. Simplerr return value: whether the calculation succeeded. Always false. This return value will never be reached.

  3. msg (string)
  4. Simplerr return value: nicely formatted error message. This return value will never be reached.