Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Java exception is thrown due to JSON parse log the raw JSON for the culprit CI #6

Open
Manj75 opened this issue Sep 18, 2019 · 2 comments

Comments

@Manj75
Copy link

Manj75 commented Sep 18, 2019

To improve on error handling and better diagnostics it would be good where an exception is thrown due to the format of the JSON an error is logged with the part of the response that caused the exception. Crucially, the sys_id of the parent/relationship/child would be handy to trace that back in SN.

When parsing our CMDB I'm see the following, but due to the size of the data set and lack of verbose message log I cannot pinpoint:

2019-09-18 12:58:32 DEBUG 719:MyImporter - Generated URL is https://nextdev.service-now.com/api/now/table/cmdb_rel_ci?sysparm_limit=850000&sysparm_fields=operational_status,sys_id,parent,type,sys_class_name,child&sysparm_query=&sysparm_exclude_reference_link=false
2019-09-18 12:58:35 TRACE 71:MyConnection - Getting relations from ServiceNow webservice ...
2019-09-18 12:59:33 TRACE 87:MyConnection - Read 65055088 bytes from ServiceNow webservice.
2019-09-18 12:59:34 FATAL 16:MyPopup - Cannot get relations from ServiceNow web service: org.codehaus.jackson.JsonParseException: Unexpected character (']' (code 93)): expected a value at [Source: java.io.StringReader@624fedfd; line: 1, column: 65054829]
2019-09-18 13:03:01 INFO 916:MyImporter - 0 relations have been modified: 0 created, 0 updated, 0 removed.

@herve91
Copy link
Contributor

herve91 commented Sep 18, 2019

The ServiceNow plugin was my first plugin. I had to learn Java, the Eclipse framework and the Archi internal classes. therefore, the graphical interface and error handling are very weak.

I will definitively improve them at some point

@herve91
Copy link
Contributor

herve91 commented Sep 22, 2019

Sorry, haven't found how to improve it very much.

Until I find, you'll have to connect to the web service manually and save it to a file, then go to the specified column using a text editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants