Better error handling and reporting with the new Error type.