Commit 0afa234f authored by Ben Galloway's avatar Ben Galloway

Improve logging for Gamma error detection

parent 07ceff58
...@@ -7,6 +7,7 @@ const callGamma = async (methodSpecs, callParamsObject) => { ...@@ -7,6 +7,7 @@ const callGamma = async (methodSpecs, callParamsObject) => {
const endpoint = config.endpoints[methodSpecs.endpoint]; const endpoint = config.endpoints[methodSpecs.endpoint];
const client = await soap.createClient(endpoint); const client = await soap.createClient(endpoint);
const callDetails = getXml(callParamsObject, methodSpecs); const callDetails = getXml(callParamsObject, methodSpecs);
config.debug(`Using endpoint: ${endpoint}`);
config.debug(callDetails); config.debug(callDetails);
const rawResponse = await client.ReceiveData({ value: callDetails }); const rawResponse = await client.ReceiveData({ value: callDetails });
...@@ -18,7 +19,13 @@ const callGamma = async (methodSpecs, callParamsObject) => { ...@@ -18,7 +19,13 @@ const callGamma = async (methodSpecs, callParamsObject) => {
if (response.hasOwnProperty("Message")) throw new ReferenceError(response.Message); if (response.hasOwnProperty("Message")) throw new ReferenceError(response.Message);
return response; return response;
} catch (error) { } catch (error) {
throw new Error(`The response from the Gamma server could not be parsed correctly. The error was "${error}"`); throw new Error(
`The response from the Gamma server could not be parsed correctly. The error was "${JSON.stringify(
error,
null,
2
)}"`
);
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment