Thread: Error messages from getfhv etc

Started: 2014-02-26 00:21:15
Last activity: 2014-03-03 18:37:04
Topics: SAC Help
Neil Selby
2014-02-26 00:21:15
The sac_i/o functions getfhv, getihv etc print error messages to standard output if the related header variable is not defined, e.g.:

ERROR 1336: Undefined header field value. DEPMIN

this seems an undesirable behaviour to me, since the functions already return an error value that the programmer can handle in their own way.

Is this the designed behaviour or is it something peculiar about my set-up that can be changed?


many thanks,

Neil

  • Brian Savage
    2014-02-25 19:48:53
    Neil,

    I agree with you, but accessing an undefined header value is (and has been) defined as an error (warning more recently).

    There is a function call to turn off all errors (or warnings), but it will also disable any errors that you may want to see.
    - sac_warning_off()
    - sac_warning_stdout()
    - sac_warning_stderr()
    - sac_error_off()
    - sac_error_stdout()
    - sac_error_stderr()

    Do you see another way to avoid these pesky error messages ?
    Should we defining these as "Warnings" ? or
    Turn off the messaging completely for undefined values in the get* functions ?
    I am asking because I am curious how the community would like to see this handled, as I have been asked this before.

    I think a recent version (circa 2011) has undefined values throws Warnings, not errors.

    Brian Savage
    savage<at>uri.edu

    On Feb 25, 2014, at 11:21 AM, Neil Selby wrote:

    The sac_i/o functions getfhv, getihv etc print error messages to standard output if the related header variable is not defined, e.g.:

    ERROR 1336: Undefined header field value. DEPMIN

    this seems an undesirable behaviour to me, since the functions already return an error value that the programmer can handle in their own way.

    Is this the designed behaviour or is it something peculiar about my set-up that can be changed?


    many thanks,

    Neil
    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help



    • Neil Selby
      2014-02-26 04:32:31
      Brian,

      thanks - yes you are right, the current version of the library gives a Warning rather than an error.

      I wasn't aware of the sac_warning_off routine, and it looks like it does exactly what I want.

      Is there a function which returns the error/warning message associated with a given code?

      many thanks,

      Neil

      Begin forwarded message:

      From: Brian Savage <savage<at>uri.edu>
      Subject: Re: [SAC-HELP] Error messages from getfhv etc
      Date: 25 February 2014 16:48:53 GMT
      To: SAC HELP <sac-help<at>iris.washington.edu>

      Neil,

      I agree with you, but accessing an undefined header value is (and has been) defined as an error (warning more recently).

      There is a function call to turn off all errors (or warnings), but it will also disable any errors that you may want to see.
      - sac_warning_off()
      - sac_warning_stdout()
      - sac_warning_stderr()
      - sac_error_off()
      - sac_error_stdout()
      - sac_error_stderr()

      Do you see another way to avoid these pesky error messages ?
      Should we defining these as "Warnings" ? or
      Turn off the messaging completely for undefined values in the get* functions ?
      I am asking because I am curious how the community would like to see this handled, as I have been asked this before.

      I think a recent version (circa 2011) has undefined values throws Warnings, not errors.

      Brian Savage
      savage<at>uri.edu

      On Feb 25, 2014, at 11:21 AM, Neil Selby wrote:

      The sac_i/o functions getfhv, getihv etc print error messages to standard output if the related header variable is not defined, e.g.:

      ERROR 1336: Undefined header field value. DEPMIN

      this seems an undesirable behaviour to me, since the functions already return an error value that the programmer can handle in their own way.

      Is this the designed behaviour or is it something peculiar about my set-up that can be changed?


      many thanks,

      Neil
      _______________________________________________
      sac-help mailing list
      sac-help<at>iris.washington.edu
      http://www.iris.washington.edu/mailman/listinfo/sac-help


      _______________________________________________
      sac-help mailing list
      sac-help<at>iris.washington.edu
      http://www.iris.washington.edu/mailman/listinfo/sac-help


      • Brian Savage
        2014-03-03 18:37:04
        Neil,

        The best best is to use
        setmsg(ktype, number)
        followed by
        outmsg()

        But if you have turned off the messages, then you will never see the error / warnings.

        There is an internal, non-exposed function call (likely to change) that returns the messages associated with error numbers.
        See getsmsg.

        Brian

        On Feb 25, 2014, at 3:32 PM, Neil Selby wrote:

        Brian,

        thanks - yes you are right, the current version of the library gives a Warning rather than an error.

        I wasn't aware of the sac_warning_off routine, and it looks like it does exactly what I want.

        Is there a function which returns the error/warning message associated with a given code?

        many thanks,

        Neil

        Begin forwarded message:

        From: Brian Savage <savage<at>uri.edu>
        Subject: Re: [SAC-HELP] Error messages from getfhv etc
        Date: 25 February 2014 16:48:53 GMT
        To: SAC HELP <sac-help<at>iris.washington.edu>

        Neil,

        I agree with you, but accessing an undefined header value is (and has been) defined as an error (warning more recently).

        There is a function call to turn off all errors (or warnings), but it will also disable any errors that you may want to see.
        - sac_warning_off()
        - sac_warning_stdout()
        - sac_warning_stderr()
        - sac_error_off()
        - sac_error_stdout()
        - sac_error_stderr()

        Do you see another way to avoid these pesky error messages ?
        Should we defining these as "Warnings" ? or
        Turn off the messaging completely for undefined values in the get* functions ?
        I am asking because I am curious how the community would like to see this handled, as I have been asked this before.

        I think a recent version (circa 2011) has undefined values throws Warnings, not errors.

        Brian Savage
        savage<at>uri.edu

        On Feb 25, 2014, at 11:21 AM, Neil Selby wrote:

        The sac_i/o functions getfhv, getihv etc print error messages to standard output if the related header variable is not defined, e.g.:

        ERROR 1336: Undefined header field value. DEPMIN

        this seems an undesirable behaviour to me, since the functions already return an error value that the programmer can handle in their own way.

        Is this the designed behaviour or is it something peculiar about my set-up that can be changed?


        many thanks,

        Neil
        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help


        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help

        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help


07:23:05 v.22510d55