fork of hey-api/openapi-ts because I need some additional things

refactor(client-fetch): improves client-fetch types to allow usage of ts-reset

btmnk 7b03fcdb 7df60593

+8 -4
+4 -2
packages/openapi-ts/src/plugins/@hey-api/client-fetch/bundle/client.ts
··· 143 143 }; 144 144 } 145 145 146 - let error = await response.text(); 146 + const textError = await response.text(); 147 + let jsonError: unknown; 147 148 148 149 try { 149 - error = JSON.parse(error); 150 + jsonError = JSON.parse(textError); 150 151 } catch { 151 152 // noop 152 153 } 153 154 155 + const error = jsonError ?? textError; 154 156 let finalError = error; 155 157 156 158 for (const fn of interceptors.error._fns) {
+4 -2
packages/openapi-ts/src/plugins/@hey-api/client-next/bundle/client.ts
··· 128 128 }; 129 129 } 130 130 131 - let error = await response.text(); 131 + const textError = await response.text(); 132 + let jsonError: unknown; 132 133 133 134 try { 134 - error = JSON.parse(error); 135 + jsonError = JSON.parse(textError); 135 136 } catch { 136 137 // noop 137 138 } 138 139 140 + const error = jsonError ?? textError; 139 141 let finalError = error; 140 142 141 143 for (const fn of interceptors.error._fns) {