× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Scott Klement wrote:

Frankly, when I was a beginner, I used the API structure a lot.
Experience taught me not to use it, because it's so limited. Now, the
only time I use it is when I'm expecting a lot of failures and the
performance of an *ESCAPE message matters to me.

Like you, I also find my use of the error code structure diminishing. I use
it when I anticipate "errors" from which I intend to recover within the
application, but for API calls where I expect everything to run smoothly I
usually use a Bytes Provided of 0 and code a monitor/on-error/endmon block.
That way the error message is easily found in the job log without needing to
resend it, I still get control, and my coding tends to be simpler.


On Wed, Dec 23, 2009 at 11:03 PM, Scott Klement <midrange-l@xxxxxxxxxxxxxxxx
wrote:

Hi Loyd,

Loyd Goodbar wrote:
Since the thread also discusses passing the error structure to an API
call
and preventing corruption of same, your passing of zero "bytes provided"
prevents the API from providing error feedback.

When you set the bytes provided field to 0, it sends you the same error
message in the form of an *ESCAPE message instead of sending in the data
structure.

Personally, I find this far more useful for two reasons:

1) You can get far more information about the message when it's sent as
an *ESCAPE message. Notably, you can get the MSGF that the message came
from (which isn't available in either of the ERRC0100 or ERRC0200
structures) knowing the msgid without knowing the msgf is, IMHO, kinda
silly.

2) I can easily re-send the message in full glory to the caller. For
example, if you ask for informaton about a user profile that doesn't
exist, or you don't have access to, I don't have to code separate
messages to send back to my caller... I can just re-send the APIs message.

I'm not doing it this way because it's "just an example". I'm doing it
that way by preference.

Frankly, when I was a beginner, I used the API structure a lot.
Experience taught me not to use it, because it's so limited. Now, the
only time I use it is when I'm expecting a lot of failures and the
performance of an *ESCAPE message matters to me.


code and you called it "ErrorNull", but was hoping to see a "correct"
example of using the error structure. Here is an include I use:

My example /was/ correct. RTFM.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.