Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions functions/servicenow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ def on_post(request: Request, config: Dict[str, object] | None, logger: Logger)
},
code=201 if response["status_code"] == 200 else response["status_code"]
)
except ValueError as v:
# ValueError can be thrown if one of the fields accessed in the response does not exist
logger.error(f"Error processing ServiceNow response: {str(v)}", exc_info=True)
return Response(
code=500,
errors=[APIError(code=500, message=f"Error creating incident: {str(v)}")]
)
except Exception as e:
# Catch-all for unexpected errors
logger.error(f"Error creating ServiceNow incident: {str(e)}", exc_info=True)
return Response(
code=500,
Expand Down