[WIP] Better error handling