I have a wrapper around all method calls as such:
export const CallReturn = async (caller, data = "") => {
const callResult = await new Promise((resolve, reject) =>
Meteor.call(caller, data, (error, result) => {
if (error) {
CallError(caller, error, data);
return reject(error);
}
resolve(result);
})
);
return callResult;
};
This allows me to catch all errors and log them to the db without configuring if (error)
on each call.
When a match failed is logged to the db, I can only see:
"message" : {
"isClientSafe" : true,
"error" : 400,
"reason" : "Match failed",
"message" : "Match failed [400]",
"errorType" : "Meteor.Error"
},
When viewing /var/log/syslog
I can see more detailed information such as the exact line where the match has failed. Is there a way to get that information in the error message?
Example check on a method:
check(data, {
challengeId: String,
type: String,
date: Date,
unit: Number,
measurementType: String,
measurementUnit: String,
userId: Match.Maybe(String)
});