In my code 'error()' doesn't work if I use it in function defined in event, but it works correctly if I use it in other code like functions. Sorry, I don't speak English good.
This is the fragment of my code where function 'onKeyDown' is defined for event 'key_down' but 'error()' in it doesn't work (something like 'print()' works correctly).