Improved error handling (returning more info/details)