Properly converting errors to string