Gorm: Error handling is poorly documented

Created on 18 Nov 2015  路  4Comments  路  Source: go-gorm/gorm

We can see there is only one example with error handling. I think the README should lead users to handle errors for each query by having error handling in all (at least, more than one) examples.

document

Most helpful comment

gorm handles errors differently than idiomatic golang, that's why you should document it more. Current documentation looks like there ll be never errors. if query fails, it might be handled, or may be not.

All 4 comments

Should the README full of error handing to double its size? ;)

Gorm's README is only for showing gorm's features to people, not teaching people write idiomatic code, but golang's doc should do that.

gorm handles errors differently than idiomatic golang, that's why you should document it more. Current documentation looks like there ll be never errors. if query fails, it might be handled, or may be not.

@jinzhu Would you be open to a PR explaining that GORM errors are driver-dependent, and that you'll need to do something like this to handle errors for your driver?

@azer Thoughts on this as a meet-in-the-middle solution?

@eenblam I ended up creating an alternative library crud

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bramp picture bramp  路  3Comments

littletwolee picture littletwolee  路  3Comments

Quentin-M picture Quentin-M  路  3Comments

pjebs picture pjebs  路  3Comments

koalacxr picture koalacxr  路  3Comments