Error handling facility for the decorator