Commit Graph

5 Commits

Author SHA1 Message Date
R.I.Pienaar
76ab1b8d17 attempt to improve UX of the error system
Previously we had a few confusing functions like NewT
and similar that were quite fragile to use due to minimal
validation and a panic in go stdlib string Replacer.

Now we generate helper methods for every string, these
are used to access errors, fill in templates and conditional
returns of error type using the new Unless() option

We now get compile time errors for some common mistakes
and have better IDE helpers for arguments etc

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-08-10 16:08:28 +02:00
R.I.Pienaar
709e256d64 Add error codes for all consumer creation errors
I wanted to supress some logging of consumer create
errors that just isn't needed and would be really
annoying on large networks, so I added many constants
and updated all errors.

I think only JSConsumerStoreFailedErrF is worth logging
on large networks else there would be quite a lot of
logs generated that one just cannot act on

Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-07-06 14:51:03 +02:00
R.I.Pienaar
7088510188 Minor updates to error data
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-05-28 15:52:22 +02:00
R.I.Pienaar
ee9d10f40b restore old error constants for backwards compat
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-05-26 08:04:50 +02:00
R.I.Pienaar
0d391b02eb richer api errors proposal
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-05-26 08:04:50 +02:00