advanced error handling [WIP]