improve error handling
This commit is contained in:
@@ -169,7 +169,7 @@ app.post("/v1/messages", (req, res) => {
|
|||||||
responseType: "stream",
|
responseType: "stream",
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
if(e.response.data) {
|
if(e?.response?.data) {
|
||||||
// print data
|
// print data
|
||||||
e.response.data.on("data", (chunk) => {
|
e.response.data.on("data", (chunk) => {
|
||||||
console.log(chunk.toString());
|
console.log(chunk.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user