mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 15:25:20 +00:00
Improved error logging as http response
This commit is contained in:
@@ -308,10 +308,18 @@ export const pass = functions.https.onRequest(
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error Uploading pass " + error);
|
console.log("Error Uploading pass " + error);
|
||||||
|
|
||||||
|
const err = Object.assign(
|
||||||
|
{},
|
||||||
|
...Object.entries(Object.getOwnPropertyDescriptors(error)).map(
|
||||||
|
([key, descriptor]) => {
|
||||||
|
return { [key]: descriptor.value };
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
response.status(500);
|
response.status(500);
|
||||||
response.send({
|
response.send({
|
||||||
explanation: JSON.stringify(error),
|
error: err,
|
||||||
result: "FAILED",
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user