[misc] Better error reporting