UNPKG
stockx-api
Version:
latest (1.1.0)
1.1.0
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
communicate with the unofficial StockX API
github.com/matthew1232/stockx-api
matthew1232/stockx-api
stockx-api
/
src
/
utils
/
checkres.js
8 lines
(7 loc)
•
276 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
writeBody =
require
(
'./writebody'
);
module
.
exports
=
(
res
) =>
{
if
(res.
statusCode
!==
200
&& res.
statusCode
!==
204
){
writeBody
(res.
body
);
throw
new
Error
(
"Status code: "
+ res.
statusCode
+
" - body: "
+ __dirname +
'/../../test/body.txt'
); } }