PM-1752 "16829 Si el workspace esta mal escrito al llamar..." SOLVED

Issue:
    16829 Si el workspace esta mal escrito al llamar a un endpoint, el estado HTTP es 503
Cause:
    No se esta creando un mensaje valido de respuesta (mensaje Restler) de error
Solution:
    Se a definido un objeto Restler para generar el error
This commit is contained in:
Victor Saisa Lopez
2015-03-23 10:21:54 -04:00
parent 83b681bffc
commit e63cad216a

View File

@@ -480,15 +480,21 @@ class WebApplication
define("PATH_TEMPORAL", PATH_C . "dynEditor/");
define("PATH_DB", PATH_DATA . "sites" . PATH_SEP);
\Bootstrap::LoadTranslationObject((defined("SYS_LANG"))? SYS_LANG : "en");
if (empty($workspace)) {
return true;
}
define("SYS_SYS", $workspace);
if (! file_exists( PATH_DB . SYS_SYS . "/db.php" )) {
throw new \Exception(\G::loadTranslation("ID_NOT_WORKSPACE"));
if (!file_exists(PATH_DB . SYS_SYS . PATH_SEP . "db.php")) {
$rest = new \Maveriks\Extension\Restler();
$rest->setMessage(new RestException(Api::STAT_APP_EXCEPTION, \G::LoadTranslation("ID_NOT_WORKSPACE")));
exit(0);
}
require_once (PATH_DB . SYS_SYS . "/db.php");
// defining constant for workspace shared directory
@@ -546,8 +552,6 @@ class WebApplication
\Propel::init(PATH_CONFIG . "databases.php");
\Bootstrap::LoadTranslationObject(defined( 'SYS_LANG' ) ? SYS_LANG : "en");
return true;
}
}