DataONEorg / bookkeeper

Bookkeeper keeps track of DataONE product subscriptions and quotas for researchers using the extended services.
Other
1 stars 2 forks source link

listOrders() returns http 500 status #70

Closed gothub closed 3 years ago

gothub commented 3 years ago

Listing orders with GET `/bookkeeper/v1/orders' causes http 500 status to be returned, with the terse error msg:

{"code":500,"message":"Couldn't list orders: null"}
gothub commented 3 years ago

@csjx This error occurred at line https://github.com/DataONEorg/bookkeeper/blob/master/src/main/java/org/dataone/bookkeeper/resources/OrdersResource.java#L148 which should be changed to

            } else if ( subject != null && ! subject.isEmpty() ) {

However, listOrders needs to be refactored, as the following need to be provided:

gothub commented 3 years ago

@csjx also, listOrders currently has the subject param, but does not have the requestor param that is documented at https://app.swaggerhub.com/apis/dataoneorg/bookkeeper/v1#/Orders/listOrders

csjx commented 3 years ago

Thanks @gothub - working on this now.

csjx commented 3 years ago

This is fixed. We had a null pointer exception in the call. I also refactored the pay() logic and the listOrders() logic to address the points above.