Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy exception logging fix #33

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/proxy.js
Expand Up @@ -55,7 +55,7 @@ function convertOptions(request, realHost, realPort, urlPrefix) {

function makeSimpleProxy(host, port, options, pluginID, serviceName) {
if (!(host && port)) {
throw new Error("Proxy: need a host and port");
throw new Error(`Proxy (${pluginID}:${serviceName}) setup failed. Host & Port for proxy destination are required but were missing. For information on how to configure a proxy service, see the Zowe wiki on dataservices (https://github.com/zowe/zlux/wiki/ZLUX-Dataservices)`);
1000TurquoisePogs marked this conversation as resolved.
Show resolved Hide resolved
}
const {urlPrefix, isHttps, addProxyAuthorizations, allowInvalidTLSProxy} =
options;
Expand Down
15 changes: 9 additions & 6 deletions js/webapp.js
Expand Up @@ -475,7 +475,7 @@ WebApp.prototype = {

makeExternalProxy(host, port, urlPrefix, isHttps, noAuth, pluginID, serviceName) {
const r = express.Router();
installLog.info(`Setting up proxy to ${host}:${port}/${urlPrefix}`);
installLog.info(`Setting up proxy (${pluginID}:${serviceName}) to destination=${host}:${port}/${urlPrefix}`);
1000TurquoisePogs marked this conversation as resolved.
Show resolved Hide resolved
let myProxy = proxy.makeSimpleProxy(host, port, {
urlPrefix,
isHttps,
Expand Down Expand Up @@ -893,15 +893,18 @@ WebApp.prototype = {
+ ' services')
const urlBase = zLuxUrl.makePluginURL(this.options.productCode,
plugin.identifier);
this._installSwaggerCatalog(plugin, urlBase);
this._installPluginStaticHandlers(plugin, urlBase);
try {
//dataservices load first since in case of error, we want to skip the rest of the plugin load
yield *this._installDataServices(pluginContext, urlBase);
this._installSwaggerCatalog(plugin, urlBase);
this._installPluginStaticHandlers(plugin, urlBase);
//import resolution will be postponed until all non-import plugins are loaded
//only push plugin if no exceptions were seen
this.plugins.push(plugin);
} catch (e) {
installLog.warn(e.stack);
installLog.warn(`Exception occurred, plugin (${plugin.identifier}) installation skipped. Message: ${e.message}`);
installLog.debug(e.stack);
}
//import resolution will be postponed until all non-import plugins are loaded
this.plugins.push(plugin);
}),

installErrorHanders() {
Expand Down