From cf4c7826b24f07d1494cdb108ea72e01c3ade0ac Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 16 Apr 2018 12:22:28 +0200 Subject: [PATCH 1/5] Update to Sentry 2.x Change-Type: patch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3cbc9bf7..4ad0c37e 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "president": "^2.0.1", "prettyjson": "^1.1.3", "progress-stream": "^2.0.0", - "raven": "^1.2.0", + "raven": "^2.5.0", "reconfix": "^0.0.3", "request": "^2.81.0", "resin-bundle-resolve": "^0.5.3", From a16ac376254f4cc51ae8b36cc454c00199bc9299 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 16 Apr 2018 12:23:31 +0200 Subject: [PATCH 2/5] Include Sentry breadcrumbs for context in error reports Change-Type: patch --- lib/app.coffee | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/app.coffee b/lib/app.coffee index 6df8f88b..adb19d60 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -17,7 +17,8 @@ limitations under the License. Raven = require('raven') Raven.disableConsoleAlerts() Raven.config require('./config').sentryDsn, - captureUnhandledRejections: true + captureUnhandledRejections: true, + autoBreadcrumbs: true, release: require('../package.json').version .install (logged, error) -> console.error(error) diff --git a/package.json b/package.json index 4ad0c37e..6ddf0b89 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "pkg": { "scripts": [ "node_modules/resin-sync/build/capitano/*.js", - "node_modules/resin-sync/build/sync/*.js" + "node_modules/resin-sync/build/sync/*.js", + "node_modules/raven/lib/instrumentation/*.js" ], "assets": [ "build/auth/pages/*.ejs", From 6a8b947c2ec6d31731d151c7d952af48606bf986 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 16 Apr 2018 13:59:11 +0200 Subject: [PATCH 3/5] Don't report lots of user input errors Change-Type: patch --- lib/actions/app.coffee | 2 +- lib/actions/build.coffee | 3 ++- lib/actions/config.coffee | 4 +++- lib/actions/environment-variables.coffee | 10 +++++++--- lib/actions/help.coffee | 3 ++- lib/actions/local/common.coffee | 3 ++- lib/actions/local/scan.coffee | 3 ++- lib/actions/local/ssh.coffee | 4 +++- lib/actions/notes.coffee | 4 +++- lib/actions/ssh.coffee | 2 +- lib/app.coffee | 5 +++-- lib/utils/docker.coffee | 3 ++- 12 files changed, 31 insertions(+), 15 deletions(-) diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index 5feb36bd..bfc2cb6a 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -52,7 +52,7 @@ exports.create = # https://github.com/resin-io/resin-cli/issues/30 resin.models.application.has(params.name).then (hasApplication) -> if hasApplication - throw new Error('You already have an application with that name!') + patterns.expectedError('You already have an application with that name!') .then -> return options.type or patterns.selectDeviceType() diff --git a/lib/actions/build.coffee b/lib/actions/build.coffee index d72cf63e..e6dc6175 100644 --- a/lib/actions/build.coffee +++ b/lib/actions/build.coffee @@ -95,6 +95,7 @@ module.exports = # compositions with many services trigger misleading warnings require('events').defaultMaxListeners = 1000 + { expectedError } = require('../utils/patterns') helpers = require('../utils/helpers') Logger = require('../utils/logger') @@ -111,7 +112,7 @@ module.exports = { application, arch, deviceType } = options if (not (arch? and deviceType?) and not application?) or (application? and (arch? or deviceType?)) - throw new Error('You must specify either an application or an arch/deviceType pair to build for') + expectedError('You must specify either an application or an arch/deviceType pair to build for') if arch? and deviceType? [ undefined, arch, deviceType ] diff --git a/lib/actions/config.coffee b/lib/actions/config.coffee index a7a821a7..c5ba62fc 100644 --- a/lib/actions/config.coffee +++ b/lib/actions/config.coffee @@ -277,10 +277,12 @@ exports.generate = form = require('resin-cli-form') deviceConfig = require('resin-device-config') prettyjson = require('prettyjson') + { generateDeviceConfig, generateApplicationConfig } = require('../utils/config') + { expectedError } = require('../utils/patterns') if not options.device? and not options.application? - throw new Error ''' + expectedError ''' You have to pass either a device or an application. See the help page for examples: diff --git a/lib/actions/environment-variables.coffee b/lib/actions/environment-variables.coffee index 4c2a0337..64e53691 100644 --- a/lib/actions/environment-variables.coffee +++ b/lib/actions/environment-variables.coffee @@ -53,17 +53,19 @@ exports.list = resin = require('resin-sdk-preconfigured') visuals = require('resin-cli-visuals') + { expectedError } = require('../utils/patterns') + Promise.try -> if options.application? return resin.models.environmentVariables.getAllByApplication(options.application) else if options.device? return resin.models.environmentVariables.device.getAll(options.device) else - throw new Error('You must specify an application or device') + expectedError('You must specify an application or device') .tap (environmentVariables) -> if _.isEmpty(environmentVariables) - throw new Error('No environment variables found') + expectedError('No environment variables found') if not options.verbose isSystemVariable = resin.models.environmentVariables.isSystemVariable environmentVariables = _.reject(environmentVariables, isSystemVariable) @@ -141,6 +143,8 @@ exports.add = Promise = require('bluebird') resin = require('resin-sdk-preconfigured') + { expectedError } = require('../utils/patterns') + Promise.try -> if not params.value? params.value = process.env[params.key] @@ -155,7 +159,7 @@ exports.add = else if options.device? resin.models.environmentVariables.device.create(options.device, params.key, params.value) else - throw new Error('You must specify an application or device') + expectedError('You must specify an application or device') .nodeify(done) exports.rename = diff --git a/lib/actions/help.coffee b/lib/actions/help.coffee index 7a252909..aa0f0325 100644 --- a/lib/actions/help.coffee +++ b/lib/actions/help.coffee @@ -18,6 +18,7 @@ _ = require('lodash') capitano = require('capitano') columnify = require('columnify') messages = require('../utils/messages') +{ expectedError } = require('../utils/patterns') parse = (object) -> return _.fromPairs _.map object, (item) -> @@ -78,7 +79,7 @@ command = (params, options, done) -> return done(error) if error? if not command? or command.isWildcard() - return done(new Error("Command not found: #{params.command}")) + expectedError("Command not found: #{params.command}") console.log("Usage: #{command.signature}") diff --git a/lib/actions/local/common.coffee b/lib/actions/local/common.coffee index 3191e226..db10f1c8 100644 --- a/lib/actions/local/common.coffee +++ b/lib/actions/local/common.coffee @@ -4,6 +4,7 @@ form = require('resin-cli-form') chalk = require('chalk') dockerUtils = require('../../utils/docker') +{ expectedError } = require('../../utils/patterns') exports.dockerPort = dockerPort = 2375 exports.dockerTimeout = dockerTimeout = 2000 @@ -23,7 +24,7 @@ exports.selectContainerFromDevice = Promise.method (deviceIp, filterSupervisor = filterOutSupervisorContainer(container) .then (containers) -> if _.isEmpty(containers) - throw new Error("No containers found in #{deviceIp}") + expectedError("No containers found in #{deviceIp}") return form.ask message: 'Select a container' diff --git a/lib/actions/local/scan.coffee b/lib/actions/local/scan.coffee index e59b2327..b8fa0fca 100644 --- a/lib/actions/local/scan.coffee +++ b/lib/actions/local/scan.coffee @@ -64,6 +64,7 @@ module.exports = { SpinnerPromise } = require('resin-cli-visuals') { dockerPort, dockerTimeout } = require('./common') dockerUtils = require('../../utils/docker') + { expectedError } = require('../../utils/patterns') if options.timeout? options.timeout *= 1000 @@ -81,7 +82,7 @@ module.exports = .catchReturn(false) .tap (devices) -> if _.isEmpty(devices) - throw new Error('Could not find any resinOS devices in the local network') + expectedError('Could not find any resinOS devices in the local network') .map ({ host, address }) -> docker = dockerUtils.createClient(host: address, port: dockerPort, timeout: dockerTimeout) Promise.props diff --git a/lib/actions/local/ssh.coffee b/lib/actions/local/ssh.coffee index 9c6d6cea..1f6ac370 100644 --- a/lib/actions/local/ssh.coffee +++ b/lib/actions/local/ssh.coffee @@ -67,10 +67,12 @@ module.exports = Promise = require 'bluebird' _ = require('lodash') { forms } = require('resin-sync') + { selectContainerFromDevice, getSubShellCommand } = require('./common') + { expectedError } = require('../../utils/patterns') if (options.host is true and options.container?) - throw new Error('Please pass either --host or --container option') + expectedError('Please pass either --host or --container option') if not options.port? options.port = 22222 diff --git a/lib/actions/notes.coffee b/lib/actions/notes.coffee index aceaf315..12ddb702 100644 --- a/lib/actions/notes.coffee +++ b/lib/actions/notes.coffee @@ -45,9 +45,11 @@ exports.set = _ = require('lodash') resin = require('resin-sdk-preconfigured') + { expectedError } = require('../utils/patterns') + Promise.try -> if _.isEmpty(params.note) - throw new Error('Missing note content') + expectedError('Missing note content') resin.models.device.note(options.device, params.note) .nodeify(done) diff --git a/lib/actions/ssh.coffee b/lib/actions/ssh.coffee index 561be990..96cc9952 100644 --- a/lib/actions/ssh.coffee +++ b/lib/actions/ssh.coffee @@ -108,7 +108,7 @@ module.exports = console.info("Connecting to: #{uuid}") resin.models.device.get(uuid) .then (device) -> - throw new Error('Device is not online') if not device.is_online + patterns.expectedError('Device is not online') if not device.is_online Promise.props username: resin.auth.whoami() diff --git a/lib/app.coffee b/lib/app.coffee index adb19d60..6c58476e 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -77,6 +77,7 @@ actions = require('./actions') errors = require('./errors') events = require('./events') update = require('./utils/update') +{ expectedError } = require('./utils/patterns') # Assign bluebird as the global promise library # stream-to-promise will produce native promises if not @@ -87,13 +88,13 @@ require('any-promise/register/bluebird') capitano.permission 'user', (done) -> resin.auth.isLoggedIn().then (isLoggedIn) -> if not isLoggedIn - throw new Error ''' + expectedError(''' You have to log in to continue Run the following command to go through the login wizard: $ resin login - ''' + ''') .nodeify(done) capitano.command diff --git a/lib/utils/docker.coffee b/lib/utils/docker.coffee index 85afce52..e02e37bc 100644 --- a/lib/utils/docker.coffee +++ b/lib/utils/docker.coffee @@ -174,5 +174,6 @@ exports.createClient = createClient = do -> return new Docker(opts) ensureDockerSeemsAccessible = (docker) -> + { expectedError } = require('./patterns') docker.ping().catch -> - throw new Error('Docker seems to be unavailable. Is it installed and running?') + expectedError('Docker seems to be unavailable. Is it installed and running?') From 37e4ec6364d1bba1e58b460452ae36260b37c274 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Tue, 17 Apr 2018 15:17:48 +0200 Subject: [PATCH 4/5] Rename expectedError to exitWithExpectedError --- lib/actions/app.coffee | 2 +- lib/actions/auth.coffee | 2 +- lib/actions/build.coffee | 4 ++-- lib/actions/config.coffee | 4 ++-- lib/actions/environment-variables.coffee | 10 +++++----- lib/actions/help.coffee | 4 ++-- lib/actions/local/common.coffee | 4 ++-- lib/actions/local/scan.coffee | 4 ++-- lib/actions/local/ssh.coffee | 4 ++-- lib/actions/notes.coffee | 4 ++-- lib/actions/os.coffee | 2 +- lib/actions/preload.coffee | 16 ++++++++-------- lib/actions/ssh.coffee | 2 +- lib/app.coffee | 4 ++-- lib/utils/docker.coffee | 4 ++-- lib/utils/patterns.ts | 2 +- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index bfc2cb6a..7fcbc3c4 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -52,7 +52,7 @@ exports.create = # https://github.com/resin-io/resin-cli/issues/30 resin.models.application.has(params.name).then (hasApplication) -> if hasApplication - patterns.expectedError('You already have an application with that name!') + patterns.exitWithExpectedError('You already have an application with that name!') .then -> return options.type or patterns.selectDeviceType() diff --git a/lib/actions/auth.coffee b/lib/actions/auth.coffee index 2df18d20..a6d87b0f 100644 --- a/lib/actions/auth.coffee +++ b/lib/actions/auth.coffee @@ -92,7 +92,7 @@ exports.login = resin.auth.whoami() .then (username) -> if !username - patterns.expectedError('Token authentication failed') + patterns.exitWithExpectedError('Token authentication failed') else if options.credentials return patterns.authenticate(options) else if options.web diff --git a/lib/actions/build.coffee b/lib/actions/build.coffee index e6dc6175..317c3b3a 100644 --- a/lib/actions/build.coffee +++ b/lib/actions/build.coffee @@ -95,7 +95,7 @@ module.exports = # compositions with many services trigger misleading warnings require('events').defaultMaxListeners = 1000 - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') helpers = require('../utils/helpers') Logger = require('../utils/logger') @@ -112,7 +112,7 @@ module.exports = { application, arch, deviceType } = options if (not (arch? and deviceType?) and not application?) or (application? and (arch? or deviceType?)) - expectedError('You must specify either an application or an arch/deviceType pair to build for') + exitWithExpectedError('You must specify either an application or an arch/deviceType pair to build for') if arch? and deviceType? [ undefined, arch, deviceType ] diff --git a/lib/actions/config.coffee b/lib/actions/config.coffee index c5ba62fc..1c71680f 100644 --- a/lib/actions/config.coffee +++ b/lib/actions/config.coffee @@ -279,10 +279,10 @@ exports.generate = prettyjson = require('prettyjson') { generateDeviceConfig, generateApplicationConfig } = require('../utils/config') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') if not options.device? and not options.application? - expectedError ''' + exitWithExpectedError ''' You have to pass either a device or an application. See the help page for examples: diff --git a/lib/actions/environment-variables.coffee b/lib/actions/environment-variables.coffee index 64e53691..e162efad 100644 --- a/lib/actions/environment-variables.coffee +++ b/lib/actions/environment-variables.coffee @@ -53,7 +53,7 @@ exports.list = resin = require('resin-sdk-preconfigured') visuals = require('resin-cli-visuals') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') Promise.try -> if options.application? @@ -61,11 +61,11 @@ exports.list = else if options.device? return resin.models.environmentVariables.device.getAll(options.device) else - expectedError('You must specify an application or device') + exitWithExpectedError('You must specify an application or device') .tap (environmentVariables) -> if _.isEmpty(environmentVariables) - expectedError('No environment variables found') + exitWithExpectedError('No environment variables found') if not options.verbose isSystemVariable = resin.models.environmentVariables.isSystemVariable environmentVariables = _.reject(environmentVariables, isSystemVariable) @@ -143,7 +143,7 @@ exports.add = Promise = require('bluebird') resin = require('resin-sdk-preconfigured') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') Promise.try -> if not params.value? @@ -159,7 +159,7 @@ exports.add = else if options.device? resin.models.environmentVariables.device.create(options.device, params.key, params.value) else - expectedError('You must specify an application or device') + exitWithExpectedError('You must specify an application or device') .nodeify(done) exports.rename = diff --git a/lib/actions/help.coffee b/lib/actions/help.coffee index aa0f0325..266fb7fa 100644 --- a/lib/actions/help.coffee +++ b/lib/actions/help.coffee @@ -18,7 +18,7 @@ _ = require('lodash') capitano = require('capitano') columnify = require('columnify') messages = require('../utils/messages') -{ expectedError } = require('../utils/patterns') +{ exitWithExpectedError } = require('../utils/patterns') parse = (object) -> return _.fromPairs _.map object, (item) -> @@ -79,7 +79,7 @@ command = (params, options, done) -> return done(error) if error? if not command? or command.isWildcard() - expectedError("Command not found: #{params.command}") + exitWithExpectedError("Command not found: #{params.command}") console.log("Usage: #{command.signature}") diff --git a/lib/actions/local/common.coffee b/lib/actions/local/common.coffee index db10f1c8..6c6242d7 100644 --- a/lib/actions/local/common.coffee +++ b/lib/actions/local/common.coffee @@ -4,7 +4,7 @@ form = require('resin-cli-form') chalk = require('chalk') dockerUtils = require('../../utils/docker') -{ expectedError } = require('../../utils/patterns') +{ exitWithExpectedError } = require('../../utils/patterns') exports.dockerPort = dockerPort = 2375 exports.dockerTimeout = dockerTimeout = 2000 @@ -24,7 +24,7 @@ exports.selectContainerFromDevice = Promise.method (deviceIp, filterSupervisor = filterOutSupervisorContainer(container) .then (containers) -> if _.isEmpty(containers) - expectedError("No containers found in #{deviceIp}") + exitWithExpectedError("No containers found in #{deviceIp}") return form.ask message: 'Select a container' diff --git a/lib/actions/local/scan.coffee b/lib/actions/local/scan.coffee index b8fa0fca..1ddf5836 100644 --- a/lib/actions/local/scan.coffee +++ b/lib/actions/local/scan.coffee @@ -64,7 +64,7 @@ module.exports = { SpinnerPromise } = require('resin-cli-visuals') { dockerPort, dockerTimeout } = require('./common') dockerUtils = require('../../utils/docker') - { expectedError } = require('../../utils/patterns') + { exitWithExpectedError } = require('../../utils/patterns') if options.timeout? options.timeout *= 1000 @@ -82,7 +82,7 @@ module.exports = .catchReturn(false) .tap (devices) -> if _.isEmpty(devices) - expectedError('Could not find any resinOS devices in the local network') + exitWithExpectedError('Could not find any resinOS devices in the local network') .map ({ host, address }) -> docker = dockerUtils.createClient(host: address, port: dockerPort, timeout: dockerTimeout) Promise.props diff --git a/lib/actions/local/ssh.coffee b/lib/actions/local/ssh.coffee index 1f6ac370..cb5b0626 100644 --- a/lib/actions/local/ssh.coffee +++ b/lib/actions/local/ssh.coffee @@ -69,10 +69,10 @@ module.exports = { forms } = require('resin-sync') { selectContainerFromDevice, getSubShellCommand } = require('./common') - { expectedError } = require('../../utils/patterns') + { exitWithExpectedError } = require('../../utils/patterns') if (options.host is true and options.container?) - expectedError('Please pass either --host or --container option') + exitWithExpectedError('Please pass either --host or --container option') if not options.port? options.port = 22222 diff --git a/lib/actions/notes.coffee b/lib/actions/notes.coffee index 12ddb702..c1e4de2a 100644 --- a/lib/actions/notes.coffee +++ b/lib/actions/notes.coffee @@ -45,11 +45,11 @@ exports.set = _ = require('lodash') resin = require('resin-sdk-preconfigured') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') Promise.try -> if _.isEmpty(params.note) - expectedError('Missing note content') + exitWithExpectedError('Missing note content') resin.models.device.note(options.device, params.note) .nodeify(done) diff --git a/lib/actions/os.coffee b/lib/actions/os.coffee index 42ffe11a..328fd1b8 100644 --- a/lib/actions/os.coffee +++ b/lib/actions/os.coffee @@ -244,7 +244,7 @@ exports.configure = options.application params.uuid ]).length != 1 - patterns.expectedError ''' + patterns.exitWithExpectedError ''' To configure an image, you must provide exactly one of: * A device, with --device diff --git a/lib/actions/preload.coffee b/lib/actions/preload.coffee index 18e45feb..fd35ce91 100644 --- a/lib/actions/preload.coffee +++ b/lib/actions/preload.coffee @@ -40,7 +40,7 @@ getApplicationsWithSuccessfulBuilds = (deviceType) -> selectApplication = (deviceType) -> visuals = require('resin-cli-visuals') form = require('resin-cli-form') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') applicationInfoSpinner = new visuals.Spinner('Downloading list of applications and releases.') applicationInfoSpinner.start() @@ -49,7 +49,7 @@ selectApplication = (deviceType) -> .then (applications) -> applicationInfoSpinner.stop() if applications.length == 0 - expectedError("You have no apps with successful releases for a '#{deviceType}' device type.") + exitWithExpectedError("You have no apps with successful releases for a '#{deviceType}' device type.") form.ask message: 'Select an application' type: 'list' @@ -59,10 +59,10 @@ selectApplication = (deviceType) -> selectApplicationCommit = (releases) -> form = require('resin-cli-form') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') if releases.length == 0 - expectedError('This application has no successful releases.') + exitWithExpectedError('This application has no successful releases.') DEFAULT_CHOICE = { 'name': LATEST, 'value': LATEST } choices = [ DEFAULT_CHOICE ].concat releases.map (release) -> name: "#{release.end_timestamp} - #{release.commit}" @@ -152,7 +152,7 @@ module.exports = preload = require('resin-preload') visuals = require('resin-cli-visuals') nodeCleanup = require('node-cleanup') - { expectedError } = require('../utils/patterns') + { exitWithExpectedError } = require('../utils/patterns') progressBars = {} @@ -184,7 +184,7 @@ module.exports = options.dontCheckDeviceType = options['dont-check-device-type'] delete options['dont-check-device-type'] if options.dontCheckDeviceType and not options.appId - expectedError('You need to specify an app id if you disable the device type check.') + exitWithExpectedError('You need to specify an app id if you disable the device type check.') # Get a configured dockerode instance dockerUtils.getDocker(options) @@ -240,7 +240,7 @@ module.exports = release = _.find preloader.application.owns__release, (release) -> release.commit.startsWith(options.commit) if not release - expectedError('There is no release matching this commit') + exitWithExpectedError('There is no release matching this commit') return release.commit selectApplicationCommit(preloader.application.owns__release) .then (commit) -> @@ -254,7 +254,7 @@ module.exports = .then -> # All options are ready: preload the image. preloader.preload() - .catch(resin.errors.ResinError, expectedError) + .catch(resin.errors.ResinError, exitWithExpectedError) .then(resolve) .catch(reject) .then(done) diff --git a/lib/actions/ssh.coffee b/lib/actions/ssh.coffee index 96cc9952..895fee1b 100644 --- a/lib/actions/ssh.coffee +++ b/lib/actions/ssh.coffee @@ -108,7 +108,7 @@ module.exports = console.info("Connecting to: #{uuid}") resin.models.device.get(uuid) .then (device) -> - patterns.expectedError('Device is not online') if not device.is_online + patterns.exitWithExpectedError('Device is not online') if not device.is_online Promise.props username: resin.auth.whoami() diff --git a/lib/app.coffee b/lib/app.coffee index 6c58476e..4d1f42b6 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -77,7 +77,7 @@ actions = require('./actions') errors = require('./errors') events = require('./events') update = require('./utils/update') -{ expectedError } = require('./utils/patterns') +{ exitWithExpectedError } = require('./utils/patterns') # Assign bluebird as the global promise library # stream-to-promise will produce native promises if not @@ -88,7 +88,7 @@ require('any-promise/register/bluebird') capitano.permission 'user', (done) -> resin.auth.isLoggedIn().then (isLoggedIn) -> if not isLoggedIn - expectedError(''' + exitWithExpectedError(''' You have to log in to continue Run the following command to go through the login wizard: diff --git a/lib/utils/docker.coffee b/lib/utils/docker.coffee index e02e37bc..f2c3094e 100644 --- a/lib/utils/docker.coffee +++ b/lib/utils/docker.coffee @@ -174,6 +174,6 @@ exports.createClient = createClient = do -> return new Docker(opts) ensureDockerSeemsAccessible = (docker) -> - { expectedError } = require('./patterns') + { exitWithExpectedError } = require('./patterns') docker.ping().catch -> - expectedError('Docker seems to be unavailable. Is it installed and running?') + exitWithExpectedError('Docker seems to be unavailable. Is it installed and running?') diff --git a/lib/utils/patterns.ts b/lib/utils/patterns.ts index 2d01b684..cd4fc11d 100644 --- a/lib/utils/patterns.ts +++ b/lib/utils/patterns.ts @@ -250,7 +250,7 @@ export function printErrorMessage(message: string) { console.error(chalk.red(`\n${messages.getHelp}\n`)); } -export function expectedError(message: string | Error) { +export function exitWithExpectedError(message: string | Error) { if (message instanceof Error) { ({ message } = message); } From 0a23563d7ea3e2b96ee737fc5550f7a3a17018b7 Mon Sep 17 00:00:00 2001 From: "resin-io-versionbot[bot]" Date: Tue, 17 Apr 2018 14:01:51 +0000 Subject: [PATCH 5/5] v7.3.3 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5974d41f..2c3fa98c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +## v7.3.3 - 2018-04-17 + +* Don't report lots of user input errors #861 [Tim Perry] +* Include Sentry breadcrumbs for context in error reports #861 [Tim Perry] +* Update to Sentry 2.x #861 [Tim Perry] + ## v7.3.2 - 2018-04-16 * Update Dockerode to fix local push issue in standalone builds #862 [Tim Perry] diff --git a/package.json b/package.json index 6ddf0b89..f0280809 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resin-cli", - "version": "7.3.2", + "version": "7.3.3", "description": "The official resin.io CLI tool", "main": "./build/actions/index.js", "homepage": "https://github.com/resin-io/resin-cli",