Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error message from SOAP response when initialize action fails #601

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bebanowski
Copy link

The current error handling approach of the initalize action is to raise a generic failure message.

For example:
NetSuite::Records::ItemReceipt.initialize with #<NetSuite::Records::PurchaseOrder:0x00007f561d8717c8> failed.

This does not provide any of the useful context from the SOAP response XML which would be more helpful for debugging the issue.

For example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2021_1.platform.webservices.netsuite.com">
      <platformMsgs:nsId>WEBSERVICES_3479023_SB2_01222024842151163424342931_794960285</platformMsgs:nsId>
    </platformMsgs:documentInfo>
  </soapenv:Header>
  <soapenv:Body>
    <initializeResponse xmlns="urn:messages_2021_1.platform.webservices.netsuite.com">
      <readResponse>
        <platformCore:status xmlns:platformCore="urn:core_2021_1.platform.webservices.netsuite.com" isSuccess="false">
          <platformCore:statusDetail type="ERROR">
            <platformCore:code>INVALID_INITIALIZE_REF</platformCore:code>
            <platformCore:message>You can not initialize itemreceipt: invalid reference 54572740.</platformCore:message>
          </platformCore:statusDetail>
        </platformCore:status>
      </readResponse>
    </initializeResponse>
  </soapenv:Body>
</soapenv:Envelope>

Support for fetching error context from the SOAP response XML has been added to other actions, for example:

Adding similar support to the initialize action, and using the message of the first error in the SOAP XML for the InitializationError raise, would provide more useful error context for debugging.

Daniel Beban added 2 commits January 22, 2024 16:01
The :upsert_list action should be correctly formatted using snake case
since the action is defined as NetSuite::Actions::UpsertList.
The current error handling approach of the initalize action is to raise
a generic failure message.

For example:
NetSuite::Records::ItemReceipt.initialize with #<NetSuite::Records::PurchaseOrder:0x00007f561d8717c8> failed.

This does not provide any of the useful context from the SOAP response
which would be more helpful for debugging the issue.

Support for fetching error context from the SOAP response XML has been
added to other actions, for example:
* NetSweet@3b756b9
* NetSweet@e640196
* NetSweet@70ab077

Adding similar support to the initialize action, and using the message
of the first error in the SOAP XML for the InitializationError raise,
would provide more useful error context for debugging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant