Properly format http errors for better messages