mirror of
/repos/Prototyper.git
synced 2025-12-30 06:31:32 +01:00
add error
This commit is contained in:
parent
2788680e77
commit
b9dc4d8280
@ -29,12 +29,16 @@ module.exports = function (config, r, connection) {
|
||||
);
|
||||
})
|
||||
.run(connection, function table_exists(err, contains) {
|
||||
if (err) {
|
||||
config.error && config.error('ERR2 getRethinkContent', err);
|
||||
return callback && callback(err);
|
||||
}
|
||||
if (contains && contains.exists) {
|
||||
return r.table(options.collection)
|
||||
.filter(options.query)
|
||||
.run(connection, function filter_table(err, cursor) {
|
||||
if (err) {
|
||||
config.error && config.error('ERR4 getRethinkContent', err);
|
||||
config.error && config.error('ERR3 getRethinkContent', err);
|
||||
return callback && callback(err);
|
||||
}
|
||||
return cursor.next(function first_item(err, result) {
|
||||
@ -78,7 +82,8 @@ module.exports = function (config, r, connection) {
|
||||
config.debug && config.debug('getRethinkAttribute result', result);
|
||||
if (result &&
|
||||
result.hasOwnProperty(options.attribute) &&
|
||||
result[options.attribute].guid) {
|
||||
result[options.attribute].guid
|
||||
) {
|
||||
attribute_options = {
|
||||
collection: options.collection,
|
||||
query: {id: result[options.attribute].guid}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user