Add error output in json extract script