octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternati


From: anonymous
Subject: [Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternative to object2json
Date: Wed, 1 Dec 2021 18:26:15 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0

Follow-up Comment #45, patch #9980 (project octave):

I recognize what you and Markus are saying about the potential of misleading
message.  And I won't argue that point. Nevertheless, I'm hesitant to simply
pass emit "regexprep" error as is.  While you and Markus and I would recognize
the proper course of action, I'm thinking of the unskilled end user.  For
him/her, seeing a error from "regexprep" could be confusing, if: 1) they don't
know what/why "regexprep" is, 2) doesn't recognize that "regexprep" is choking
on the input JSON string (as opposed to some other string, like the regex
pattern string).

Regardless, where you suggesting to leave "fromJSON" alone for now? 

Or alternative, I could implement a screen for this very specific, likely
error, e.g.:


try 
  str = regexprep(str, '^[\s,]*','');

catch err

  if( regexpi(err.message, "invalid(.*)UTF-8") );
    error("Invalid UTF-8 encoding of JSON string");
  else
    error(err);
  end

end_try_catch


Unfortunately, I'm unable (unskilled) to get Oct 7 built.  Thus, I'm still
unable to replicate and test this against offending JSON strings.

K

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9980>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]