Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic occurs with mysql and sqlite if sql throws error #12

Closed
kdar opened this issue Feb 18, 2013 · 1 comment
Closed

panic occurs with mysql and sqlite if sql throws error #12

kdar opened this issue Feb 18, 2013 · 1 comment
Assignees
Labels

Comments

@kdar
Copy link

kdar commented Feb 18, 2013

In both the mysql and sqlite wraper, in collection.FindAll, there is code like this:

rows, _ := t.parent.doQuery(
    fmt.Sprintf("SELECT %s FROM %s", fields, t.Name()),
    fmt.Sprintf("WHERE %s", conditions), args,
    sort, limit, offset,
)

it doesn't check for an error. If doQuery throws an error (like a column not existing), then it will panic with a nil reference instead of panicing with an error that described what actually happened.

@ghost ghost assigned xiam Feb 18, 2013
xiam added a commit that referenced this issue Feb 21, 2013
@xiam
Copy link
Contributor

xiam commented Feb 21, 2013

Thanks for your report, it's fixed. We'll return an error instead of panicking in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants