@nsshunt/stsfhirclient 2.0.45 → 2.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9823,8 +9823,14 @@ var FhirRESTClient = class {
9823
9823
  };
9824
9824
  else throw new Error(`FhirRESTClient:GetResource(): No response from #InvokeResourceAPI`);
9825
9825
  } catch (error) {
9826
- this.LogError("GetResource", error);
9827
- throw error;
9826
+ if (axios.isAxiosError(error)) {
9827
+ const axiosError = error;
9828
+ return {
9829
+ status: axiosError.response.status,
9830
+ body: axiosError.response.data,
9831
+ headers: { ETag: axiosError.response.headers["etag"] }
9832
+ };
9833
+ } else throw error;
9828
9834
  }
9829
9835
  };
9830
9836
  PutResource = async (resourceType, domainResource, versionIdETag) => {
@@ -9879,8 +9885,14 @@ var FhirRESTClient = class {
9879
9885
  };
9880
9886
  else throw new Error(`FhirRESTClient:GetHistoryInstanceFhirResource(): No response from #InvokeResourceAPI`);
9881
9887
  } catch (error) {
9882
- this.LogError("GetHistoryInstanceFhirResource", error);
9883
- throw error;
9888
+ if (axios.isAxiosError(error)) {
9889
+ const axiosError = error;
9890
+ return {
9891
+ status: axiosError.response.status,
9892
+ body: axiosError.response.data,
9893
+ headers: { ETag: axiosError.response.headers["etag"] }
9894
+ };
9895
+ } else throw error;
9884
9896
  }
9885
9897
  };
9886
9898
  ExtractNumber(str) {
@@ -9898,8 +9910,15 @@ var FhirRESTClient = class {
9898
9910
  };
9899
9911
  else throw new Error(`FhirRESTClient:DeleteResource(): No response from #InvokeResourceAPI`);
9900
9912
  } catch (error) {
9901
- this.LogError("DeleteResource", error);
9902
- throw error;
9913
+ if (axios.isAxiosError(error)) {
9914
+ const axiosError = error;
9915
+ const versionNumber = this.ExtractNumber(versionIdETag) + 1;
9916
+ return {
9917
+ status: axiosError.response.status,
9918
+ body: axiosError.response.data,
9919
+ headers: { ETag: `W/"${versionNumber}"` }
9920
+ };
9921
+ } else throw error;
9903
9922
  }
9904
9923
  };
9905
9924
  GetMetadata = async () => {