return json array with code and reason in sync mode error