Fixed crash in error handling flow

Shouldn't have a local variable 'json' when 'dart:json' is imported as 'json'