Skip to content

Conversation

@stolen
Copy link

@stolen stolen commented Feb 14, 2025

Add a hardcoded hook to show the user some info on request badness.
May be extended later to support rfc9457 as requested in #66

Copy link
Member

@javiergarea javiergarea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! This is a good first step to improve the error reporting.
I included a small suggestion, but LGTM overall 🚀

Comment on lines +331 to 338
erl_syntax:application(
erl_syntax:atom(erf_util),
erl_syntax:atom(handle_invalid_request),
[
erl_syntax:integer(400),
erl_syntax:list([]),
erl_syntax:atom(undefined)
erl_syntax:variable('Request'),
erl_syntax:variable('Reason')
]
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 [
    erl_syntax:tuple(
        [
            erl_syntax:integer(400),
            erl_syntax:list([]),
            erl_syntax:application(
                erl_syntax:atom(io_lib),
                erl_syntax:atom(print),
                [erl_syntax:variable('Reason')]
            )
        ]
    )
]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind moving the handle_invalid_request function to an inline check like the above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📑 TODO

Development

Successfully merging this pull request may close these issues.

2 participants