Check error not found error type
@@ -52,8 +52,11 @@ func (r *MongoRepository) FindByName(name string) (*Definition, error) {
err := coll.Find(bson.M{"name": name}).One(&result)
if err != nil {
+ if err == mgo.ErrNotFound {
return nil, ErrAPIDefinitionNotFound
}
+ return nil, err
+ }
return result, err
}
