diff --git a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala index 26794c2b04..d4213c5200 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/Boot.scala @@ -696,15 +696,15 @@ class Boot extends MdcLoggable { }) LiftRules.exceptionHandler.prepend{ -// case(_, r, e) if tryo(DB.use(DefaultConnectionIdentifier){ conn => conn}.isClosed).getOrElse(true) => { -// logger.error("Exception being returned to browser when processing " + r.uri.toString, e) -// JsonResponse( -// Extraction.decompose(ErrorMessage(code = 500, message = s"${ErrorMessages.DatabaseConnectionClosedError}")), -// 500 -// ) -// } + case(_, r, e) if e.isInstanceOf[NullPointerException] && e.getMessage.contains("Looking for Connection Identifier") => { + logger.error(s"Exception being returned to browser when processing url is ${r.request.uri}, method is ${r.request.method}, exception detail is $e", e) + JsonResponse( + Extraction.decompose(ErrorMessage(code = 500, message = s"${ErrorMessages.DatabaseConnectionClosedError}")), + 500 + ) + } case(Props.RunModes.Development, r, e) => { - logger.error("Exception being returned to browser when processing " + r.uri.toString, e) + logger.error(s"Exception being returned to browser when processing url is ${r.request.uri}, method is ${r.request.method}, exception detail is $e", e) JsonResponse( Extraction.decompose(ErrorMessage(code = 500, message = s"${ErrorMessages.InternalServerError} ${showExceptionAtJson(e)}")), 500 @@ -712,7 +712,7 @@ class Boot extends MdcLoggable { } case (_, r , e) => { sendExceptionEmail(e) - logger.error("Exception being returned to browser when processing " + r.uri.toString, e) + logger.error(s"Exception being returned to browser when processing url is ${r.request.uri}, method is ${r.request.method}, exception detail is $e", e) JsonResponse( Extraction.decompose(ErrorMessage(code = 500, message = s"${ErrorMessages.InternalServerError}")), 500 diff --git a/obp-api/src/main/scala/code/snippet/WebUI.scala b/obp-api/src/main/scala/code/snippet/WebUI.scala index a2edfd1590..3c42a53296 100644 --- a/obp-api/src/main/scala/code/snippet/WebUI.scala +++ b/obp-api/src/main/scala/code/snippet/WebUI.scala @@ -243,7 +243,12 @@ class WebUI extends MdcLoggable{ // Link to API Manager def apiManagerLink: CssSel = { - ".api-manager-link a [href]" #> wrapPropsUrlLocaleParameter("webui_api_manager_url") + if (getWebUiPropsValue("webui_api_manager_url", "").isEmpty) { + ".api-manager-link a [style]" #> "display:none" + } else { + ".api-manager-link a [style]" #> "display:block" & + ".api-manager-link a [href]" #> wrapPropsUrlLocaleParameter("webui_api_manager_url") + } } // Link to OBP-CLI