renaming to 'sdc'
This commit is contained in:
parent
d10b13cbfa
commit
d64ea56308
@ -12,7 +12,7 @@ var sprintf = require('extsprintf').sprintf;
|
||||
var common = require('./common');
|
||||
|
||||
|
||||
var CONFIG_PATH = path.resolve(process.env.HOME, '.joyentcloudconfig.json');
|
||||
var CONFIG_PATH = path.resolve(process.env.HOME, '.sdcconfig.json');
|
||||
var DEFAULTS_PATH = path.resolve(__dirname, '..', 'etc', 'defaults.json');
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ function loadConfigSync() {
|
||||
}
|
||||
config.profiles.push({
|
||||
name: 'env',
|
||||
account: process.env.SDC_USER || process.env.SDC_ACCOUNT,
|
||||
user: process.env.SDC_USER || process.env.SDC_ACCOUNT,
|
||||
keyId: process.env.SDC_KEY_ID,
|
||||
rejectUnauthorized: common.boolFromString(
|
||||
process.env.SDC_TESTING || process.env.SDC_TLS_INSECURE)
|
||||
|
@ -19,7 +19,7 @@ var verror = require('verror'),
|
||||
* Base error. Instances will always have a string `message` and
|
||||
* a string `code` (a CamelCase string).
|
||||
*/
|
||||
function JoyentError(options) {
|
||||
function SDCError(options) {
|
||||
assert.object(options, 'options');
|
||||
assert.string(options.message, 'options.message');
|
||||
assert.string(options.code, 'options.code');
|
||||
@ -38,7 +38,7 @@ function JoyentError(options) {
|
||||
self[k] = options[k];
|
||||
});
|
||||
}
|
||||
util.inherits(JoyentError, VError);
|
||||
util.inherits(SDCError, VError);
|
||||
|
||||
function InternalError(cause, message) {
|
||||
if (message === undefined) {
|
||||
@ -46,29 +46,47 @@ function InternalError(cause, message) {
|
||||
cause = undefined;
|
||||
}
|
||||
assert.string(message);
|
||||
JoyentError.call(this, {
|
||||
SDCError.call(this, {
|
||||
cause: cause,
|
||||
message: message,
|
||||
code: 'InternalError',
|
||||
exitStatus: 1
|
||||
});
|
||||
}
|
||||
util.inherits(InternalError, JoyentError);
|
||||
util.inherits(InternalError, SDCError);
|
||||
|
||||
|
||||
/**
|
||||
* CLI usage error
|
||||
*/
|
||||
function UsageError(cause, message) {
|
||||
if (message === undefined) {
|
||||
message = cause;
|
||||
cause = undefined;
|
||||
}
|
||||
assert.string(message);
|
||||
JoyentError.call(this, {
|
||||
SDCError.call(this, {
|
||||
cause: cause,
|
||||
message: message,
|
||||
code: 'Usage',
|
||||
exitStatus: 1
|
||||
});
|
||||
}
|
||||
util.inherits(UsageError, JoyentError);
|
||||
util.inherits(UsageError, SDCError);
|
||||
|
||||
|
||||
/**
|
||||
* An error signing a request.
|
||||
*/
|
||||
function SigningError(cause) {
|
||||
SDCError.call(this, {
|
||||
cause: cause,
|
||||
message: 'error signing request',
|
||||
code: 'Signing',
|
||||
exitStatus: 1
|
||||
});
|
||||
}
|
||||
util.inherits(SigningError, SDCError);
|
||||
|
||||
|
||||
/**
|
||||
@ -81,7 +99,7 @@ function MultiError(errs) {
|
||||
var err = errs[i];
|
||||
lines.push(format(' error (%s): %s', err.code, err.message));
|
||||
}
|
||||
JoyentError.call(this, {
|
||||
SDCError.call(this, {
|
||||
cause: errs[0],
|
||||
message: lines.join('\n'),
|
||||
code: 'MultiError',
|
||||
@ -89,16 +107,17 @@ function MultiError(errs) {
|
||||
});
|
||||
}
|
||||
MultiError.description = 'Multiple errors.';
|
||||
util.inherits(MultiError, JoyentError);
|
||||
util.inherits(MultiError, SDCError);
|
||||
|
||||
|
||||
|
||||
// ---- exports
|
||||
|
||||
module.exports = {
|
||||
JoyentError: JoyentError,
|
||||
SDCError: SDCError,
|
||||
InternalError: InternalError,
|
||||
UsageError: UsageError,
|
||||
SigningError: SigningError,
|
||||
MultiError: MultiError
|
||||
};
|
||||
// vim: set softtabstop=4 shiftwidth=4:
|
||||
|
Reference in New Issue
Block a user