Tabnine Logo For Javascript
Error
Code IndexAdd Tabnine to your IDE (free)

How to use
Error
function
in
parse

Best JavaScript code snippets using parse.Error(Showing top 15 results out of 315)

origin: parse-community/parse-server

this.config.database.loadSchema().then(schemaController => schemaController.hasClass(this.className)).then(hasClass => {
   if (hasClass !== true) {
    throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'This user is not allowed to access ' + 'non-existent class: ' + this.className);
   }
  })
origin: parse-community/parse-server

it('first with error', function (done) {
  const query = new Parse.Query(BoxedNumber);
  query.equalTo('$foo', 'bar');
  query
   .first()
   .then(done.fail)
   .catch((e) => expect(e.code).toBe(Parse.Error.INVALID_KEY_NAME))
   .then(done);
 });
origin: parse-community/parse-server

this.config.database.find('_User', {
    objectId: this.objectId()
   }).then(results => {
    if (results.length != 1) {
     throw undefined;
    }

    if (this.data.password.indexOf(results[0].username) >= 0) return Promise.reject(new Parse.Error(Parse.Error.VALIDATION_ERROR, containsUsernameError));
    return Promise.resolve();
   })
origin: parse-community/parse-server

Object.keys(authData).map(provider => {
  if (authData[provider] === null) {
   return Promise.resolve();
  }

  const validateAuthData = this.config.authDataManager.getValidatorForProvider(provider);

  if (!validateAuthData) {
   throw new Parse.Error(Parse.Error.UNSUPPORTED_SERVICE, 'This authentication method is unsupported.');
  }

  return validateAuthData(authData[provider]);
 })
origin: parse-community/parse-server

it('invalid query invalid key', done => {
  const options = Object.assign({}, masterKeyOptions, {
   body: {
    unknown: {},
   },
  });
  get(Parse.serverURL + '/aggregate/TestObject', options).catch(error => {
   expect(error.error.code).toEqual(Parse.Error.INVALID_QUERY);
   done();
  });
 });
origin: parse-community/parse-server

it('afterSaveFile should throw error', async () => {
  await reconfigureServer({ filesAdapter: mockAdapter });
  Parse.Cloud.afterSaveFile(async () => {
   throw new Parse.Error(400, 'some-error-message');
  });
  const filename = 'donald_duck.pdf';
  const file = new Parse.File(filename, [1, 2, 3], 'text/plain');
  try {
   await file.save({ useMasterKey: true });
  } catch (error) {
   expect(error.message).toBe('some-error-message');
  }
 });
origin: parse-community/parse-server

createSession().then(results => {
   if (!results.response) {
    throw new Parse.Error(Parse.Error.INTERNAL_SERVER_ERROR, 'Error creating session.');
   }

   sessionData['objectId'] = results.response['objectId'];
   this.response = {
    status: 201,
    location: results.location,
    response: sessionData
   };
  })
origin: parse-community/parse-server

this.config.database.destroy('_Installation', delQuery).catch(err => {
     if (err.code == Parse.Error.OBJECT_NOT_FOUND) {
      // no deletions were made. Can be ignored.
      return;
     } // rethrow the error


     throw err;
    });
origin: parse-community/parse-server

this.config.database.destroy('_Installation', delQuery).then(() => {
     return deviceTokenMatches[0]['objectId'];
    }).catch(err => {
     if (err.code == Parse.Error.OBJECT_NOT_FOUND) {
      // no deletions were made. Can be ignored
      return;
     } // rethrow the error


     throw err;
    })
origin: parse-community/parse-server

it('regexes with invalid options fail', function (done) {
  const query = new Parse.Query(TestObject);
  query.matches('myString', 'FootBall', 'some invalid option');
  query
   .find()
   .then(done.fail)
   .catch((e) => expect(e.code).toBe(Parse.Error.INVALID_QUERY))
   .then(done);
 });
origin: parse-community/parse-server

it('beforeSaveFile should throw error', async () => {
  await reconfigureServer({ filesAdapter: mockAdapter });
  Parse.Cloud.beforeSaveFile(() => {
   throw new Parse.Error(400, 'some-error-message');
  });
  const file = new Parse.File('popeye.txt', [1, 2, 3], 'text/plain');
  try {
   await file.save({ useMasterKey: true });
  } catch (error) {
   expect(error.message).toBe('some-error-message');
  }
 });
origin: parse-community/parse-server

it('find with error', function (done) {
  const query = new Parse.Query(BoxedNumber);
  query.equalTo('$foo', 'bar');
  query
   .find()
   .then(done.fail)
   .catch((error) => expect(error.code).toBe(Parse.Error.INVALID_KEY_NAME))
   .then(done);
 });
origin: parse-community/parse-server

it('invalid query group _id', done => {
  const options = Object.assign({}, masterKeyOptions, {
   body: {
    group: { _id: null },
   },
  });
  get(Parse.serverURL + '/aggregate/TestObject', options).catch(error => {
   expect(error.error.code).toEqual(Parse.Error.INVALID_QUERY);
   done();
  });
 });
origin: parse-community/parse-server

it('invalid query group objectId required', done => {
  const options = Object.assign({}, masterKeyOptions, {
   body: {
    group: {},
   },
  });
  get(Parse.serverURL + '/aggregate/TestObject', options).catch(error => {
   expect(error.error.code).toEqual(Parse.Error.INVALID_QUERY);
   done();
  });
 });
origin: parse-community/parse-server

this.config.database.destroy('_Installation', delQuery).catch(err => {
      if (err.code == Parse.Error.OBJECT_NOT_FOUND) {
       // no deletions were made. Can be ignored.
       return;
      } // rethrow the error


      throw err;
     });
parse(npm)Error

Most used parse functions

  • Cloud
  • Config
  • User
  • ACL
  • ACL.ACL
  • ACL.setPublicReadAccess,
  • ACL.setPublicWriteAccess,
  • ACL.setReadAccess,
  • ACL.setRoleReadAccess,
  • ACL.setRoleWriteAccess,
  • ACL.setWriteAccess,
  • Analytics,
  • FacebookUtils,
  • File,
  • File.File,
  • File._name,
  • File._url,
  • File.addMetadata

Popular in JavaScript

  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • mocha
    simple, flexible, fun test framework
  • moment
    Parse, validate, manipulate, and display dates
  • colors
    get colors in your node.js console
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • http
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • lodash
    Lodash modular utilities.
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now