If there is an error, we should handle it first. Otherwise, some keys might not be found in the results (e.g. 'object' or type') and cause a crash.
If there is an error, we should handle it first. Otherwise, some keys might not be found in the results (e.g. 'object' or type') and cause a crash.