From 4aa14aaaba88e9d7bb8fa5477b2f276e199ad922 Mon Sep 17 00:00:00 2001 From: Austen Collins Date: Tue, 15 Jan 2019 22:21:14 -0800 Subject: [PATCH] remove platform docs --- bin/serverless | 36 +++++++++++++++++--------------- docs/README.md | 2 +- docs/platform/README.md | 31 --------------------------- docs/platform/commands/README.md | 20 ------------------ docs/platform/commands/login.md | 26 ----------------------- docs/platform/commands/logout.md | 22 ------------------- 6 files changed, 20 insertions(+), 117 deletions(-) delete mode 100644 docs/platform/README.md delete mode 100644 docs/platform/commands/README.md delete mode 100644 docs/platform/commands/login.md delete mode 100644 docs/platform/commands/logout.md diff --git a/bin/serverless b/bin/serverless index baefb710a..1c1fe0405 100755 --- a/bin/serverless +++ b/bin/serverless @@ -43,23 +43,25 @@ const invocationId = uuid.v4(); return serverless.init() .then(() => serverless.run()) .then(() => process.exit(0)) - .catch((e) => { - if (serverless.service.deployment && serverless.service.deployment.deploymentId) { - const deploymentData = { - tenant: serverless.service.deployment.tenant, - app: serverless.service.deployment.app, - serviceName: serverless.service.deployment.serviceName, - deploymentId: serverless.service.deployment.deploymentId, - accessKey: serverless.service.deployment.accessKey, - }; - deploymentData.status = 'Failed'; - return platform.updateDeployment(deploymentData) - .then(() => { - throw e; - }); - } - throw e; - }); + .catch((err) => { + // If Enterprise Plugin, capture error + let enterpriseErrorHandler = null; + serverless.pluginManager.plugins.forEach((p) => { + if (p.enterprise && p.enterprise.errorHandler) { + enterpriseErrorHandler = p.enterprise.errorHandler; + } + }); + if (!enterpriseErrorHandler) { throw err; } + return enterpriseErrorHandler(err, invocationId) + .catch((error) => { + // if (process.env.SLS_DEBUG) { + console.log(error) + // } + }) + .then(() => { + throw err + }); + }) }).catch(e => { process.exitCode = 1; logError(e); diff --git a/docs/README.md b/docs/README.md index 9df779283..5c302cb6f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,6 @@ title: Serverless Framework Documentation menuText: Docs layout: Doc menuItems: - - {menuText: Getting Started, path: /framework/docs/getting-started/} - {menuText: Providers, path: /framework/docs/providers} - {menuText: "- AWS", path: /framework/docs/providers/aws/} - {menuText: "- Azure", path: /framework/docs/providers/azure/} @@ -13,6 +12,7 @@ menuItems: - {menuText: "- Kubeless" , path: /framework/docs/providers/kubeless/} - {menuText: "- Spotinst" , path: /framework/docs/providers/spotinst/} - {menuText: "- Cloudflare" , path: /framework/docs/providers/cloudflare/} + - {menuText: Enterprise, path: https://www.github.com/serverless/enterprise} --> diff --git a/docs/platform/README.md b/docs/platform/README.md deleted file mode 100644 index ae74c5400..000000000 --- a/docs/platform/README.md +++ /dev/null @@ -1,31 +0,0 @@ - - - -### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/platform) - - -# Serverless Platform (Beta) - -The Serverless Platform is currently in experimental beta. If you'd like to participate in the beta, please refer to the [full platform docs.](https://github.com/serverless/platform) - -## Beta CLI Commands - -Logging in to the platform enables access to beta features of the Serverless framework. - -### [`serverless emit`](./commands/emit.md) -Emit an event to an event-gateway. - -### [`serverless login`](./commands/login.md) -Register or log in to the platform. - -### [`serverless logout`](./commands/logout.md) -Logout of the platform. diff --git a/docs/platform/commands/README.md b/docs/platform/commands/README.md deleted file mode 100644 index 197973e9d..000000000 --- a/docs/platform/commands/README.md +++ /dev/null @@ -1,20 +0,0 @@ - - - -### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/platform) - - - -## Beta CLI Commands - -Logging in to the platform enables access to beta features of the Serverless framework. - -### [`serverless login`](./login.md) -Register or log in to the platform. - -### [`serverless logout`](./logout.md) -Logout of the platform. diff --git a/docs/platform/commands/login.md b/docs/platform/commands/login.md deleted file mode 100644 index af07b7099..000000000 --- a/docs/platform/commands/login.md +++ /dev/null @@ -1,26 +0,0 @@ - - - -### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/platform/commands/login) - - -# Login - -The `login` command logs users into the serverless platform. - -It will create a new serverless platform account if one doesn't already exist. - -*This command opens a browser window* - -```bash -serverless login - -# Shorthand -sls login -``` diff --git a/docs/platform/commands/logout.md b/docs/platform/commands/logout.md deleted file mode 100644 index f39b55342..000000000 --- a/docs/platform/commands/logout.md +++ /dev/null @@ -1,22 +0,0 @@ - - - -### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/platform/commands/logout) - - -# Logout - -The `logout` command logs users out the serverless platform. - -```bash -serverless logout - -# Shorthand -sls logout -```