Error handling for user functions.