|
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.
wrote:
Hi Loyd,
Loyd Goodbar wrote:
Since the thread also discusses passing the error structure to an APIcall
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 mailing list archive is Copyright 1997-2025 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.