golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
14.48k stars 1.34k forks source link

Improve Error Message for Invalid Source Path #1102

Closed Shion1305 closed 3 weeks ago

Shion1305 commented 4 weeks ago

Is your feature request related to a problem? Please describe.

If I specify an invalid file path for migrate.New as the source path, the error message will look like this.

.: The system cannot find the path specified.

The error message does not contain a source path, so it is hard to determine the error from this message. Path . comes from a hard-coded part as follows, so the error does not provide a valuable message. https://github.com/golang-migrate/migrate/blob/04b36ebaac41964a54faa3e4b35254963dd88a3d/source/file/file.go#L31-L34 It would be better if the error message contained a specified source path or if the error message said the source path was wrong.