Skip to content

Commit

Permalink
Merge pull request #126 from identity-com/email-phone-validation-errors
Browse files Browse the repository at this point in the history
Define new error codes for phone and email validation
  • Loading branch information
lucmir authored Aug 14, 2019
2 parents 6fe33b6 + 23becd1 commit 0518e14
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@identity.com/credential-commons",
"version": "1.0.25",
"version": "1.0.26",
"author": "Identity.com Community",
"license": "MIT",
"description": "Verifiable Credential and Attestation Library",
Expand Down
35 changes: 33 additions & 2 deletions src/errors/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ const ErrorCodes = {
*/
ERROR_IDV_VALIDATION_INVALID_DOC: 'error.idv.validation.invalid.doc',

/**
* Reason: The IDV detected that the provided phone is invalid.
* Troubleshooting: Make sure the provided phone is a valid one.
*/
ERROR_IDV_VALIDATION_INVALID_PHONE: 'error.idv.validation.invalid.phone',

/**
* Reason: The IDV detected that the provided email is invalid.
* Troubleshooting: Make sure the provided email is a valid one.
*/
ERROR_IDV_VALIDATION_INVALID_EMAIL: 'error.idv.validation.invalid.email',

/**
* Reason: The IDV detected that the provided document is unsupported.
* Troubleshooting: Make sure the provided document is a valid one.
Expand Down Expand Up @@ -231,11 +243,30 @@ const ErrorCodes = {
ERROR_IDV_UCA_UPDATE_NO_PROCESS_STATUS: 'error.idv.uca.update.no.process.status',

/**
* Reason: An SMS token is received before one is issued
* Troubleshooting: Try again
* Reason: A token is received before one is issued
* Troubleshooting: Try again
*/
ERROR_IDV_TOKEN_RECEIVED_BEFORE_ISSUE: 'error.idv.token.received.before.issue',

/**
* Reason: Unable to send the token
* Troubleshooting: Try again
*/
ERROR_IDV_TOKEN_SENDING_FAILED: 'error.idv.token.sending.failed',

/**
* Reason: The provided token is expired
* Troubleshooting: Request a new token
*/
ERROR_IDV_TOKEN_EXPIRED: 'error.idv.token.expired',

/**
* Reason: The provided token does not match the generated one
* Troubleshooting: Make sure to provide the received token
*/
ERROR_IDV_TOKEN_MISMATCH: 'error.idv.token.mismatch',


// CW ERRORS

/**
Expand Down

0 comments on commit 0518e14

Please sign in to comment.