You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm currently writing an browser extension and I decided to use codetabs API "https://api.codetabs.com/v1/loc/?github=" and I came across an idea which would help developers while using codetabs API. if you try to check "https://api.codetabs.com/v1/loc/?github=torvalds/linux" and "https://api.codetabs.com/v1/loc/?github=cryp70m4n/something" you get same JSON response format but different error message {"Error:": "Some error"}. Based on this fact I was thinking it would be nice if your API had some way for an end-developer to be able to find out what was the error without parsing every possible error message that could occur. For example you could add something like this {"Error": "Some error", "ErrorCode": -2} and based on this error code we could know if we were rated limited, repository was too big, repository doesn't exist, etc,... You could easily implement that and then write description of each error code in documentation.
Thanks.
The text was updated successfully, but these errors were encountered:
Cryp70m4n
changed the title
Add better errors on github loc API
Add better error responses on github loc API
Feb 26, 2023
Cryp70m4n
changed the title
Add better error responses on github loc API
Improve error responses on github loc API
Feb 26, 2023
Hello, I'm currently writing an browser extension and I decided to use codetabs API "https://api.codetabs.com/v1/loc/?github=" and I came across an idea which would help developers while using codetabs API. if you try to check "https://api.codetabs.com/v1/loc/?github=torvalds/linux" and "https://api.codetabs.com/v1/loc/?github=cryp70m4n/something" you get same JSON response format but different error message {"Error:": "Some error"}. Based on this fact I was thinking it would be nice if your API had some way for an end-developer to be able to find out what was the error without parsing every possible error message that could occur. For example you could add something like this {"Error": "Some error", "ErrorCode": -2} and based on this error code we could know if we were rated limited, repository was too big, repository doesn't exist, etc,... You could easily implement that and then write description of each error code in documentation.
Thanks.
The text was updated successfully, but these errors were encountered: