Kim Alvefur
57c3771614
util.error: Fix error on conversion of invalid error stanza, fix #1805
...
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.
3 years ago
Kim Alvefur
43531740f9
util: Prefix module imports with prosody namespace
3 years ago
Matthew Wild
9d303c4eed
util.error: Switch to util.debug traceback tables and remove display_tracebacks option
5 years ago
Matthew Wild
600e9c1f40
util.error: Expose is_error on registry objects for convenience
5 years ago
Matthew Wild
d9c8000cc7
util.error: rename is_err() -> is_error()
...
More descriptive and consistent with e.g. is_promise().
5 years ago
Matthew Wild
e875910c5d
util.error: Add coerce and wrap methods to registry(?) objects
5 years ago
Kim Alvefur
8ae67fb1fd
util.error: Remove a stray word from a comment
...
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.
5 years ago
Matthew Wild
58e33e3995
util.error: Pass through existing error objects passed to new()
5 years ago
Kim Alvefur
33070035bf
util.error: Drop registry initialization with namespace as key
...
Enough complexity with compact vs normal and with/without namespace
5 years ago
Kim Alvefur
9dbdb91c47
util.error: Expand compact registries into normal form internally
...
Also the exposed form on the table returned from init()
5 years ago
Kim Alvefur
5da983d8bd
util.error: Add a "compact mode" for registries
...
Inspired by the older registry in pubsub.lib.lua
5 years ago
Kim Alvefur
d101532cfc
util.error: Expose source and registry as fields on the registry object
...
For access, e.g. to identify and compare errors later
5 years ago
Kim Alvefur
04be6c2e83
util.error: Turns out <gone> wasn't alone, there's also <redirect>
5 years ago
Kim Alvefur
60a6ee0d30
util.error: Pass converted stanza errors throguh new()
...
In order to benefit from common processing
5 years ago
Kim Alvefur
a51d591246
util.error: Collect Application-Specific Conditions from stanza errors
5 years ago
Kim Alvefur
3c7cbd0e2c
util.error: Add special case handling of <gone> with an URI
5 years ago
Kim Alvefur
8627f2e4d5
util.error: Default error originator to stanza sender
...
The @by attribute is primarily useful for errors caused by intermediate
entities.
5 years ago
Kim Alvefur
0354452a9a
util.error: Extract error originator from stanza errors
5 years ago
Kim Alvefur
ed5841e42b
util.error: Add well-known field 'extra'
...
A place for various extra fields and edge cases of the stanza error data
model, e.g. the URI field of <gone>
5 years ago
Matthew Wild
a34633771d
util.error: Simplify error creation flow
5 years ago
Matthew Wild
2595c39a8a
util.error: Switch coerce() to use new() and change 'native' to context field 'wrapped_error'
5 years ago
Matthew Wild
891a03885a
util.error: Have init() return an object to allow API extensibility via additional methods
5 years ago
Matthew Wild
9c709d29fd
util.error: Minor tweaks to error creation code to prepare for future changes
5 years ago
Matthew Wild
73e87f3901
util.error: Simplify error creation - remove ability to set context from templates, and remove default context
5 years ago
Matthew Wild
646bd1da3d
util.error: Add unique 'instance_id' to error objects
5 years ago
Kim Alvefur
a114e8cf02
util.error: Add a wrapper for common parameters
...
Lets you set up source and registry once per module
5 years ago
Kim Alvefur
df7cf5c388
util.error: Add a 'source' parameter where origin module can be mentioned
5 years ago
Matthew Wild
5c04c5ce38
util.error: Add configuration for including traceback in tostring()
5 years ago
Matthew Wild
7507996371
util.error: Allow optional tracebacks to be injected on errors
...
This allows extra debug info to be provided for development purposes.
5 years ago
Kim Alvefur
87d0125802
util.error: Move default for numeric error code to net.http.server
...
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.
6 years ago
Kim Alvefur
a55d83ceb6
util.error: Write down some thoughts in comments
6 years ago
Kim Alvefur
03adb50555
util.error: Add well-known field 'code' in error templates
...
Intended to be for HTTP-ish numeric status codes
6 years ago
Kim Alvefur
078178a3ba
util.error: Fix traceback due to missing text field
7 years ago
Kim Alvefur
3b3af4805c
util.error: Add a function for creating an error object from an error stanza
7 years ago
Matthew Wild
464121c5b7
util.error: Add new util library for structured errors
7 years ago