<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Ok, I think we have to seperate two things:</p>
    <p>1) posting error messages</p>
    <p>2) obtaining error codes</p>
    <p>I think Roman is primarly interested in 2), so that his patches
      can programmatically deal with certain error conditions.</p>
    <p>Of course, 1) and 2) can be combined into a single object,
      basically errno + strerror.</p>
    <p>I just shudder at the thought that users would start parsing
      error messages. After all, error messages are meant for display
      and can change at any moment. In the future, error messages might
      even get localized.<br>
    </p>
    <p>I find it extremely important to add proper error codes from the
      start to establish good practices.</p>
    <p>
      <blockquote type="cite">i mean, there currently is no such thing
        and if you want to use it you have to hope for the object author
        to implement it.
      </blockquote>
      Sure. But library authors could update their objects to introduce
      error codes. If well designed, error codes could be entirely
      optional, e.g. [errno] outputting -1 if no error code was set.<br>
    </p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 14.06.2021 15:55, IOhannes m
      zmoelnig wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c071f736-23b5-1794-6c76-b05ab6a9c5a5@iem.at">On 6/14/21
      3:33 PM, Christof Ressi wrote:
      <br>
      <blockquote type="cite">
        <br>
        Here's another idea, which I don't really love, but which I
        would prefer over your proposed [canvaserror]:
        <br>
        <br>
        Method calls which can generate an error send the error code to
        a global [errno] object and the user can query the current error
        state with a bang. This would be similar to 'errno' in C.
        <br>
      </blockquote>
      <br>
      <br>
      but which error-code?
      <br>
      i mean, there currently is no such thing and if you want to use it
      you have to hope for the object author to implement it.
      <br>
      <br>
      the nice thing about the [patcherror] object is that no changes
      would be required to whatever objects (apart from the patch that
      uses it, obviously; but that's true for all solutions).
      <br>
      <br>
      i also like the possibility, to suppress error printout (e.g. when
      opening an *optional* configuration file).
      <br>
      <br>
      and: it would allow us to catch *multiple* errors (e.g. if an
      object emitted two errors in a row, without stopping to send
      something to the outlet so we can query the errno).
      <br>
      as well as being able to catch errors that are not triggered by a
      message directly (think: delayed opening of a file; either because
      this happens only when dsp is turned on, or even in a separate
      thread).
      <br>
      <br>
      <br>
      gamdrs
      <br>
      IOhannes
      <br>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
  </body>
</html>