Return 4xx when user has incompatible import path
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 542
- Avg merge
- 7d 21h
- Merged PRs (30d)
- 2
Description
I have a [sample repo](https://github.com/leitzler/modbug) that outputs the following error when i run `go run main.go`:
```
go: github.com/gofrs/uuid@v0.0.0-20180930033549-48eeef780dd5: go.mod has post-v0 module path "github.com/gofrs/uuid/v3" at revision 48eeef780dd5
```
The error is due to incorrect import paths in my project, and can be fixed by updating them.
However when I do use athens as proxy, it returns `500 Internal server error`:
```
go: github.com/gofrs/uuid@v0.0.0-20180930033549-48eeef780dd5: unexpected status (http://athens.azurefd.net/github.com/gofrs/uuid/@v/v0.0.0-20180930033549-48eeef780dd5.info): 500 Internal Server Error
```
As a user I might not have access to the athens logs where the details can be found.
Since it is a error introduced by the user, that can be fixed by the user, I suggest that athens returns `4xx` instead, like `422 Unprocessable entity`.
Contributor guide
Research direction
Reproduce the incompatible import-path error with the sample repo's main.go using the Athens proxy, then trace how Athens handles the failed module lookup. Done means user-caused incompatible paths return a 4xx response, such as 422, instead of 500, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100