How to use the @cumulus/cmr-client.ValidationError function in @cumulus/cmr-client

To help you get started, we’ve selected a few @cumulus/cmr-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nasa / cumulus / packages / cmrjs / utils.js View on Github external
json: true,
      body: ummMetadata,
      headers: {
        Accept: 'application/json',
        'Content-type': `application/vnd.nasa.cmr.umm+json;version=${version}`
      }
    });

    if (result.statusCode === 200) {
      return true;
    }
  } catch (e) {
    result = e.response;
  }

  throw new ValidationError(
    `Validation was not successful. UMM metadata Object: ${JSON.stringify(ummMetadata)}`
  );
}

@cumulus/cmr-client

A Node.js client to NASA's Common Metadata Repository (CMR) API.

Apache-2.0
Latest version published 21 days ago

Package Health Score

76 / 100
Full package analysis