jQuery fulfils responseJSON because we are always passing dataType of 'json' with all of our request (can be seen in ui-core connection.ts request function).
see https://api.jquery.com/jquery.ajax/#data-types for more info on responseJSON.
For errors, responseJSON should just resolve to a string, with the extra quotes parsed for us by jQuery.
For cases this doesn't work, we use responseText to ensure we always show a string.
jQuery fulfils responseJSON because we are always passing dataType of 'json' with all of our request (can be seen in ui-core connection.ts request function). see https://api.jquery.com/jquery.ajax/#data-types for more info on responseJSON.
For errors, responseJSON should just resolve to a string, with the extra quotes parsed for us by jQuery. For cases this doesn't work, we use responseText to ensure we always show a string.