json: Add error handling to `dynamic`.