-
Notifications
You must be signed in to change notification settings - Fork 807
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
TINKERPOP-1044: Gremlin server REST endpoint - Add Exception Class and Message in Response #440
Conversation
…nd the gremlin query results in a groovy script Exception/Error, will output the Throwable class name as well as the Throwable Message in the message body of the HTTP Response
Nice work. Looks good for the REST endpoint. I'm wondering - what about other endpoints such as websocket - shouldn't they be consistent? Also, I would expect the same information to be available when using a gremlin driver. |
I added this functionality to the REST endpoint because I am using the HttpChannelizer, I can add the functionality to the other channelizers manually but I think you are getting at that there should be some common response between all channelizer methods that is defined in only one location |
Could be. I'm not familiar enough with the channelizers to know for sure. I'm mostly just selfishly interested in getting the exception type when using the java driver, so this inconsistency jumped out at me. |
…er for the exception class instead of making a message with multiple lines
First of all, thanks for taking the time to do this. TINKERPOP-1044 was less about REST and more about the Gremlin Server protocol but as it turns out the issue is the same in REST as it is over there.
There's no such place to do that. There isn't any shared exception processing logic between REST and the Gremlin Server protocol. I think you would add that logic here: Lines 260 to 266 in 850e159
as i look at it now the error messaging logic is a bit weird there to begin with (i.e. if we don't have an "error message" we just use the class simple name?? - no idea why that is like that). Note that there are a number of integration tests that may fail if with these changes you are making as they rely on the asserting error messages in some cases. If you haven't done so already please be sure to run those tests:
Also, please add an entry to the CHANGELOG that describes your fix: |
I'm having trouble running the tests on my Windows Box (the tests fail on different modules so I don't think that this change caused the failures). I also see that the CI build passed which should indicate that the unit tests that are not running probably fail to run due to Windows-specific shenanigans. I'll update this once I can successfully run tests on my box. UPDATE I notice here that the only check that the test is running is for the 500 status code (which I am still sending along with the updated message). Furthermore, I grep'd through the integration tests to see if I could find the default error message and confirmed that none of the gremlin-server integration tests contain that constant. I know that this is not robust but its all I can really do until I figure out how to properly run tests on my box |
Sorry for the trouble on running the tests. It's not terribly friendly to Windows as we don't have any core devs who use that OS. Hopefully you can figure out how to get the tests working. Maybe they won't run well with maven, but might run from an IDE like Intellij? |
Luckily I was able to spin up a Linux VM and run the integration tests Output of mvn verify Results : Also, I am currently using titan 1 which depends on gremlin-server 3.1 i think, what would be the best way to adapt this change to my current distro of titan? |
Glad that's working. Did you still intend to make the fix for the other channelizers in As for titan, i guess you would build this branch of tinkerpop with the work ongoing here: thinkaurelius/titan#1312 |
Do you mean modify the appropriate handlers for NIO and WebSocket or is there a different module to look at? |
We intend to freeze the code base for release of 3.2.3 (and 3.1.5) in a couple of days. If you'd like to see this merged in time for 3.2.3, we'd need to have your changes pretty soon for review. No pressure, of course....I just wanted to inform you of our release schedule in case you really needed this change in an official packaged release. |
Would it be possible to merge this change then and add the other functionality as a different ticket? |
Ok - I'll look to just merge this as-is then will add in the change to the other channelizers. |
This was a pretty simple change - merge this via CTR |
When using Gremlin-Server Client over REST endpoint and the gremlin query results in a groovy script Exception/Error, will output the Throwable class name as well as the Throwable Message in the message body of the HTTP Response