From aa58982e2a16dfaf4f83768d6eaff3c1aa4809fc Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Tue, 17 Jul 2018 16:51:13 +0000 Subject: [PATCH] TRITON-598 "triton network get-default" should print error when no default network is set Reviewed by: Robert Mustacchi Reviewed by: Trent Mick Approved by: Trent Mick --- CHANGES.md | 5 +++++ lib/do_network/do_get_default.js | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8b5dca7..1b3d4c3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,11 @@ Known issues: ## not yet released +## 6.1.1 + +- [TRITON-598] Fix error handling for `triton network get-default` when + no default network is set on the account. + ## 6.1.0 - [joyent/node-triton#250] Avoid an error from `triton profile list` if diff --git a/lib/do_network/do_get_default.js b/lib/do_network/do_get_default.js index 3340547..df848ea 100644 --- a/lib/do_network/do_get_default.js +++ b/lib/do_network/do_get_default.js @@ -5,7 +5,7 @@ */ /* - * Copyright 2017 Joyent, Inc. + * Copyright (c) 2018, Joyent, Inc. * * `triton network get-default ...` */ @@ -47,7 +47,7 @@ function do_get_default(subcmd, opts, args, cb) { var defaultNetwork = conf.default_network; if (!defaultNetwork) { - cb('default network not found'); + cb(new Error('account has no default network configured')); return; } diff --git a/package.json b/package.json index 2c7354f..337c993 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "triton", "description": "Joyent Triton CLI and client (https://www.joyent.com/triton)", - "version": "6.1.0", + "version": "6.1.1", "author": "Joyent (joyent.com)", "homepage": "https://github.com/joyent/node-triton", "dependencies": {