LearningProcesss / boardgamegeekjsclient

Typescript written API wrapper for Boardgamegeek XML2 API
MIT License
17 stars 5 forks source link

Response model refactor #23

Open LearningProcesss opened 2 years ago

LearningProcesss commented 2 years ago

Response model refactor to better handle possible BGG internal server error (502) or rejection like #18, #25, #38

proposal idea

interface BggResponse<T>{
   error: string
   status: number
   data: T[]
}
ericpoulinnz commented 1 year ago

@LearningProcesss something like this would be hugely helpful for my team. Last night many users where throwing a 202 error for me. I could see that when calling the API directly. However through this library I only got an empty response after some time.

Knowing that there was an error, and the error code is very important to be able to give the user correct feedback.