Open rolznz opened 1 year ago
@kiwiidb this issue doesn't seem to complex to solve. Can I give it a try?
My suggestion is to create a method that returns the BadArgumentsError
and can be passed an argument to append to the already available property Message: "Bad arguments",
I would suggest to just pass the same string that is passed to Errorf
c.Logger().Errorf("Failed to load addinvoice request body: %v", err)
return c.JSON(http.StatusBadRequest, responses.BadArgumentsError)
All cases should be checked if this string contains data that should not be revealed.
Any concerns? Am I missing something?
Should be good, please make a PR including an integration test and a some examples of the error JSON's in the PR description.
If an invalid request is provided it would be nice to return to the caller why the arguments were bad rather than just "bad arguments".
I am not sure of the security implications here.
https://github.com/getAlby/lndhub.go/blob/main/lib/responses/errors.go#L25