Skip to content

Commit

Permalink
Set throwStubExceptions to true for the /Astronomy/execute method
Browse files Browse the repository at this point in the history
  • Loading branch information
lukejagodzinski committed Feb 15, 2018
1 parent 1a792f0 commit 9fbf8c2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 97 deletions.
80 changes: 42 additions & 38 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,69 +1,73 @@
allow-deny@1.0.6
autoupdate@1.3.12
babel-compiler@6.20.0
babel-runtime@1.0.1
allow-deny@1.1.0
autoupdate@1.4.0
babel-compiler@7.0.4
babel-runtime@1.2.0
[email protected]
[email protected]
[email protected]
[email protected]
boilerplate-generator@1.2.0
boilerplate-generator@1.4.0
[email protected]
[email protected]
callback-hook@1.0.10
check@1.2.5
callback-hook@1.1.0
check@1.3.0
[email protected]
ddp@1.3.0
ddp-client@2.1.3
ddp-common@1.2.9
ddp-server@2.0.2
ddp@1.4.0
ddp-client@2.3.1
ddp-common@1.4.0
ddp-server@2.1.2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
http@1.2.12
id-map@1.0.9
http@1.4.0
id-map@1.1.0
[email protected]
jagi:[email protected].1
jagi:[email protected].4
[email protected]
local-test:jagi:[email protected].1
[email protected].17
local-test:jagi:[email protected].4
[email protected].19
mdg:[email protected]
meteor@1.7.1
minimongo@1.3.1
modules@0.10.0
modules-runtime@0.8.0
mongo@1.2.0
mongo-dev-server@1.0.1
meteor@1.8.2
minimongo@1.4.3
modules@0.11.3
modules-runtime@0.9.1
mongo@1.4.2
mongo-dev-server@1.1.0
[email protected]
[email protected].30
[email protected].33
[email protected]
ordered-dict@1.0.9
ordered-dict@1.1.0
practicalmeteor:[email protected]_1
practicalmeteor:[email protected]_2
practicalmeteor:[email protected]_2
practicalmeteor:[email protected]
practicalmeteor:[email protected]_2
promise@0.9.0
random@1.0.10
promise@0.10.1
random@1.1.0
[email protected]
reload@1.1.11
retry@1.0.9
reload@1.2.0
retry@1.1.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]
tinytest@1.0.12
tinytest@1.1.0
tmeasday:[email protected]
[email protected]
[email protected]
url@1.1.0
webapp@1.3.19
url@1.2.0
webapp@1.5.0
[email protected]
4 changes: 2 additions & 2 deletions lib/modules/methods/class_prototype_methods/applyMethod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import callStandardMeteorMethod from "../../storage/utils/callStandardMeteorMethod";
import callMeteorMethod from "../../storage/utils/call_meteor_method";
import rawAll from "../../fields/utils/rawAll";

function applyMethod(methodName, methodArgs, callback) {
Expand All @@ -15,7 +15,7 @@ function applyMethod(methodName, methodArgs, callback) {
})
};

return callStandardMeteorMethod(
return callMeteorMethod(
Class,
"/Astronomy/execute",
[meteorMethodArgs],
Expand Down
70 changes: 34 additions & 36 deletions lib/modules/storage/module.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
import Module from '../../core/module.js';
import Module from "../../core/module.js";
// Utils.
import applyModifier from './utils/apply_modifier.js';
import callMeteorMethod from './utils/call_meteor_method.js';
import callStandardMeteorMethod from './utils/callStandardMeteorMethod.js';
import classInsert from './utils/class_insert.js';
import classUpdate from './utils/class_update.js';
import classRemove from './utils/class_remove.js';
import documentInsert from './utils/document_insert.js';
import documentUpdate from './utils/document_update.js';
import documentRemove from './utils/document_remove.js';
import getModified from './utils/getModified';
import getModifier from './utils/getModifier';
import hasMeteorMethod from './utils/has_meteor_method.js';
import isModified from './utils/isModified';
import isRemote from './utils/is_remote.js';
import omitUndefined from './utils/omit_undefined.js';
import throwIfSelectorIsNotId from './utils/throw_if_selector_is_not_id.js';
import transformToClass from './utils/transformToClass';
import triggerBeforeSave from './utils/trigger_before_save.js';
import triggerBeforeInsert from './utils/trigger_before_insert.js';
import triggerBeforeUpdate from './utils/trigger_before_update.js';
import triggerBeforeRemove from './utils/trigger_before_remove.js';
import triggerAfterSave from './utils/trigger_after_save.js';
import triggerAfterInsert from './utils/trigger_after_insert.js';
import triggerAfterUpdate from './utils/trigger_after_update.js';
import triggerAfterRemove from './utils/trigger_after_remove.js';
import wrapTransform from './utils/wrapTransform.js';
import applyModifier from "./utils/apply_modifier.js";
import callMeteorMethod from "./utils/call_meteor_method.js";
import classInsert from "./utils/class_insert.js";
import classUpdate from "./utils/class_update.js";
import classRemove from "./utils/class_remove.js";
import documentInsert from "./utils/document_insert.js";
import documentUpdate from "./utils/document_update.js";
import documentRemove from "./utils/document_remove.js";
import getModified from "./utils/getModified";
import getModifier from "./utils/getModifier";
import hasMeteorMethod from "./utils/has_meteor_method.js";
import isModified from "./utils/isModified";
import isRemote from "./utils/is_remote.js";
import omitUndefined from "./utils/omit_undefined.js";
import throwIfSelectorIsNotId from "./utils/throw_if_selector_is_not_id.js";
import transformToClass from "./utils/transformToClass";
import triggerBeforeSave from "./utils/trigger_before_save.js";
import triggerBeforeInsert from "./utils/trigger_before_insert.js";
import triggerBeforeUpdate from "./utils/trigger_before_update.js";
import triggerBeforeRemove from "./utils/trigger_before_remove.js";
import triggerAfterSave from "./utils/trigger_after_save.js";
import triggerAfterInsert from "./utils/trigger_after_insert.js";
import triggerAfterUpdate from "./utils/trigger_after_update.js";
import triggerAfterRemove from "./utils/trigger_after_remove.js";
import wrapTransform from "./utils/wrapTransform.js";
// Hooks.
import onInitSchema from './hooks/init_schema.js';
import onInitDefinition from './hooks/init_definition.js';
import onParseDefinition from './hooks/parse_definition.js';
import onMergeDefinitions from './hooks/merge_definitions.js';
import onApplyDefinition from './hooks/apply_definition.js';
import onInitClass from './hooks/init_class.js';
import onInitSchema from "./hooks/init_schema.js";
import onInitDefinition from "./hooks/init_definition.js";
import onParseDefinition from "./hooks/parse_definition.js";
import onMergeDefinitions from "./hooks/merge_definitions.js";
import onApplyDefinition from "./hooks/apply_definition.js";
import onInitClass from "./hooks/init_class.js";

Module.create({
name: 'storage',
name: "storage",
onInitSchema: onInitSchema,
onInitDefinition: onInitDefinition,
onParseDefinition: onParseDefinition,
Expand All @@ -45,7 +44,6 @@ Module.create({
utils: {
applyModifier,
callMeteorMethod,
callStandardMeteorMethod,
classInsert,
classUpdate,
classRemove,
Expand All @@ -70,4 +68,4 @@ Module.create({
triggerAfterRemove,
wrapTransform
}
});
});
10 changes: 0 additions & 10 deletions lib/modules/storage/utils/callStandardMeteorMethod.js

This file was deleted.

16 changes: 5 additions & 11 deletions lib/modules/storage/utils/call_meteor_method.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
function callMeteorMethod(
Class, methodName, methodArgs, callback
) {
const callMeteorMethod = (Class, methodName, methodArgs, callback) => {
const Collection = Class.getCollection();
let connection = Collection && Collection._connection;
if (!connection && (!Collection || !Collection._name)) {
connection = Meteor.connection;
connection = Meteor.connection || Meteor.server;
}

// Prepare meteor method options.
const methodOptions = {
throwStubExceptions: true,
returnStubValue: true
};
return connection.apply(methodName, methodArgs, methodOptions, callback);
};

return connection.apply(
methodName, methodArgs, methodOptions, callback
);
}

export default callMeteorMethod;
export default callMeteorMethod;

0 comments on commit 9fbf8c2

Please sign in to comment.