aboutsummaryrefslogtreecommitdiffstats
path: root/util/error.lua
Commit message (Collapse)AuthorAgeFilesLines
* util.error: Fix error on conversion of invalid error stanza, fix #1805Kim Alvefur2023-04-191-1/+1
| | | | | | | | | Error stanzas should have an <error> element, but if you pass a stanza without one to util.error.from_stanza() it triggers an attempt to index a nil value, which this patch avoids. In the conditional, it should be safe to assume error_tag is non-nil since condition can't have those values then.
* util.error: Switch to util.debug traceback tables and remove ↵Matthew Wild2020-12-091-9/+6
| | | | display_tracebacks option
* util.error: Expose is_error on registry objects for convenienceMatthew Wild2020-12-091-0/+1
|
* util.error: rename is_err() -> is_error()Matthew Wild2020-12-091-5/+6
| | | | More descriptive and consistent with e.g. is_promise().
* util.error: Add coerce and wrap methods to registry(?) objectsMatthew Wild2020-12-091-0/+19
|
* util.error: Remove a stray word from a commentKim Alvefur2020-11-141-1/+1
| | | | | | | | | | | Earlier in the process the namespace could be given in the registry table, the comment would have read > registry can be given as second argument if namespace is either not > used or is given in the registry table The word seems to have been left when this method was scrapped for being complicated and redundant.
* util.error: Pass through existing error objects passed to new()Matthew Wild2020-10-151-0/+1
|
* util.error: Drop registry initialization with namespace as keyKim Alvefur2020-09-281-4/+0
| | | | Enough complexity with compact vs normal and with/without namespace
* util.error: Expand compact registries into normal form internallyKim Alvefur2020-09-281-8/+34
| | | | Also the exposed form on the table returned from init()
* util.error: Add a "compact mode" for registriesKim Alvefur2020-09-281-4/+7
| | | | Inspired by the older registry in pubsub.lib.lua
* util.error: Expose source and registry as fields on the registry objectKim Alvefur2020-09-281-0/+2
| | | | For access, e.g. to identify and compare errors later
* util.error: Turns out <gone> wasn't alone, there's also <redirect>Kim Alvefur2020-09-281-2/+7
|
* util.error: Pass converted stanza errors throguh new()Kim Alvefur2020-09-271-6/+3
| | | | In order to benefit from common processing
* util.error: Collect Application-Specific Conditions from stanza errorsKim Alvefur2020-09-261-2/+3
|
* util.error: Add special case handling of <gone> with an URIKim Alvefur2020-09-261-0/+3
|
* util.error: Default error originator to stanza senderKim Alvefur2020-09-261-1/+2
| | | | | The @by attribute is primarily useful for errors caused by intermediate entities.
* util.error: Extract error originator from stanza errorsKim Alvefur2020-09-261-1/+6
|
* util.error: Add well-known field 'extra'Kim Alvefur2020-09-261-0/+2
| | | | | A place for various extra fields and edge cases of the stanza error data model, e.g. the URI field of <gone>
* util.error: Simplify error creation flowMatthew Wild2020-09-251-1/+13
|
* util.error: Switch coerce() to use new() and change 'native' to context ↵Matthew Wild2020-09-251-5/+3
| | | | field 'wrapped_error'
* util.error: Have init() return an object to allow API extensibility via ↵Matthew Wild2020-09-251-3/+5
| | | | additional methods
* util.error: Minor tweaks to error creation code to prepare for future changesMatthew Wild2020-09-251-2/+5
|
* util.error: Simplify error creation - remove ability to set context from ↵Matthew Wild2020-09-251-1/+1
| | | | templates, and remove default context
* util.error: Add unique 'instance_id' to error objectsMatthew Wild2020-09-251-0/+2
|
* util.error: Add a wrapper for common parametersKim Alvefur2020-08-281-0/+7
| | | | Lets you set up source and registry once per module
* util.error: Add a 'source' parameter where origin module can be mentionedKim Alvefur2020-08-281-1/+2
|
* util.error: Add configuration for including traceback in tostring()Matthew Wild2020-08-281-2/+12
|
* util.error: Allow optional tracebacks to be injected on errorsMatthew Wild2020-08-281-0/+15
| | | | This allows extra debug info to be provided for development purposes.
* util.error: Move default for numeric error code to net.http.serverKim Alvefur2019-12-141-1/+1
| | | | | | Stanza errors can also have numbers but these are a legacy thing and rarely used, except in MUC. HTTP errors on the other hand always have a number.
* util.error: Write down some thoughts in commentsKim Alvefur2019-12-081-0/+7
|
* util.error: Add well-known field 'code' in error templatesKim Alvefur2019-11-011-0/+1
| | | | Intended to be for HTTP-ish numeric status codes
* util.error: Fix traceback due to missing text fieldKim Alvefur2019-07-101-1/+1
|
* util.error: Add a function for creating an error object from an error stanzaKim Alvefur2018-12-301-0/+12
|
* util.error: Add new util library for structured errorsMatthew Wild2018-12-301-0/+40