-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const url = require('url'); | ||
const pkg = require('../../package.json'); | ||
|
||
const homepage = url.format({...url.parse(pkg.homepage), ...{hash: null}}); | ||
const linkify = file => `${homepage}/blob/master/${file}`; | ||
|
||
module.exports = { | ||
EINVALIDASSETS: ({assets}) => ({ | ||
message: 'Invalid `assets` option.', | ||
details: `The [assets option](${linkify( | ||
'README.md#assets' | ||
)}) option must be an \`Array\` of \`Strings\` or \`Objects\` with a \`path\` property. | ||
Your configuration for the \`assets\` option is \`${assets}\`.`, | ||
}), | ||
EINVALIDMESSAGE: ({message}) => ({ | ||
message: 'Invalid `message` option.', | ||
details: `The [message option](${linkify('README.md#message')}) option, if defined, must be a non empty \`String\`. | ||
Your configuration for the \`successComment\` option is \`${message}\`.`, | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const SemanticReleaseError = require('@semantic-release/error'); | ||
const ERROR_DEFINITIONS = require('./definitions/errors'); | ||
|
||
module.exports = (code, ctx) => { | ||
const {message, details} = ERROR_DEFINITIONS[code](ctx); | ||
return new SemanticReleaseError(message, code, details); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters