How to catch any err msg in Meteor?


In the official docs, I see this:"methodName", function (error) {
      // identify the error
      if (error.error === "logged-out") {
        // show a nice error message
        Session.set("errorMessage", "Please log in to post a comment.");

I want to catch an exception in a method regardless of what the err msg is. Is this the way to do that:'insertJobLocationData', companyid, jobloc, function (err) {
    if (err) {
      Session.set("lastErrMsg", "insertJobLocationData failed");



use FlashMessages,