-
Notifications
You must be signed in to change notification settings - Fork 18
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
How to catch Validator error #224
Comments
How I see function: |
I just did minimal changes in pull request - #225 . |
Hello @kirill-ratkin |
@kirill-ratkin just checked PR #225 async def custom_validation_error_cb(msg):
# custom msg handling
log.error(f"something wrong")
@app.listen("some.subject", validator=SomeValidator, validation_error_cb=custom_validation_error_cb)
async def foo(msg):
# msg handling if everything allright
log.info(f"got message {msg.data}") What do you think? Would it be convenient for your case? |
Hi. For my perpective wrapped functoin should not be called in this case and custom_validation_error_cb should be responsible for error handling. In my case I'll inform sender in reply about validation error. Good idea! |
We will think about a wrapped function. I can't guarantee but i think we will release the new version by the end of next week, the new version will include the validation error callback feature. |
#227 Update in new panini release - v0.7.1 |
In case of validation error a log message appears in console.
But example says no about how to catch the exception.
Could you add such logic to example or say couple words here how to do it?
I try to override method
validated_message
in my custom validator class inherited fromValidator.
It doesn't work :(.
The text was updated successfully, but these errors were encountered: