material 0.8.0 → 0.8.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "A lightweight implementation of Material Design Components for the web - ES6",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,7 +21,7 @@ const request = async (url, method = 'GET', body = null, headers = {}, signal =
21
21
  try {
22
22
  const response = await fetch(url, options)
23
23
  if (!response.ok) {
24
- throw new Error(`Network response was not ok! ${response.status}`)
24
+ console.log('Error', response)
25
25
  }
26
26
 
27
27
  // Determine response type based on 'Accept' header
@@ -31,8 +31,11 @@ const request = async (url, method = 'GET', body = null, headers = {}, signal =
31
31
  return await response.json()
32
32
  }
33
33
  } catch (error) {
34
- console.error('There has been a problem with your fetch operation:', error)
35
- return { error }
34
+ if (headers.Accept === 'text/xml') {
35
+ return error
36
+ } else {
37
+ return { error }
38
+ }
36
39
  }
37
40
  }
38
41