Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize errors in csp-config #107

Open
smarlowucf opened this issue Jun 21, 2023 · 3 comments
Open

Standardize errors in csp-config #107

smarlowucf opened this issue Jun 21, 2023 · 3 comments
Labels
Core July Needed in July release

Comments

@smarlowucf
Copy link
Collaborator

Currently the errors list in csp-config is expected to be a list of strings. However, some error strings contain a mix of text and marshalled json. This format is not ingestible in a way that it could be easily parsed.

Errors should be either a marshalled json string with a standard set of keys such as title, description. Or they should all be flat strings with no structured data.

@smarlowucf smarlowucf added Core July Needed in July release labels Jun 21, 2023
@smarlowucf
Copy link
Collaborator Author

Also, consider including a timestamp somehow which could be used to pinpoint the location in the log file where the error occurred. This could be useful for debugging the problem.

@rtamalin
Copy link
Contributor

Marshalled JSON would make it easier for machine processing, and still be reasonably human readable.

Even if we don't use marshalled JSON it should still be possible to "structure" the content of a error message string, e.g. the string construction process can include a prefix that is the time the issue occurs at, and some other useful info...

Potentially we could handle/implement this in the base CSPBillingAdapterException, so that the str() renders the desired structured string format, and add a json() method that can produce the marshalled JSON format...

@smarlowucf
Copy link
Collaborator Author

The offending error messages have been cleaned up. There should be no more embedded json in error messages. However, we can leave this open to still consider more robust error messaging. This is also tangential to #89 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core July Needed in July release
Projects
None yet
Development

No branches or pull requests

2 participants