Skip to content

Improve error responses on github loc API #28

Open
@Cryp70m4n

Description

@Cryp70m4n

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions