More flexible error formatting #354
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: hanssv
When errors (and warnings?) are put together they are prepared for presentation as a string. This is not always great, for example:
https://github.com/aeternity/aesophia_http/issues/80
and https://github.com/aeternity/aesophia_http/issues/79
We should move the formatting further down the line (
ppfunction inaeso_errors?) - and perhaps provide more ways to present the raw error-structures.@hanssv Moving the formatting down the line (in this case moving
mk_errorfromaeso_ast_infer_typestoaeso_errors) would allow throwing errors in their original form (e.g.{unbound_variables, {id, _, "x"}}instead of#errrecord) and it would then be possible foraesophia_httpto write its own version ofmk_errorto make errors formatting suitable for the output ofaesophia_http.Another way would be to write 2 versions of the errors messages that is produced by
mk_error, the current one, and one that is suitable for the output ofaesophia_http(without new lines and without line and col numbers) and have a command line option to choose which type of formatting do we want.The first method would require making changes to
aesophia_httpwhen new types errors are added, and the second might bloat the code, especially if more types of formatting are added in the future.