Skip to content

Commit

Permalink
Removed all getIsDeveloperMode related code
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Feb 7, 2024
1 parent f561888 commit 907d672
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ public function contentsAction()
$this->loadLayout('empty');
$this->renderLayout();
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
$result = ['error' => true, 'message' => $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()];
} else {
$result = ['error' => true, 'message' => $e->getMessage()];
}
$result = ['error' => true, 'message' => $e->getMessage()];
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
}
Expand All @@ -92,11 +88,7 @@ public function newFolderAction()
$path = $this->getStorage()->getSession()->getCurrentPath();
$result = $this->getStorage()->createDirectory($name, $path);
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
$result = ['error' => true, 'message' => $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()];
} else {
$result = ['error' => true, 'message' => $e->getMessage()];
}
$result = ['error' => true, 'message' => $e->getMessage()];
}
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
Expand All @@ -107,11 +99,7 @@ public function deleteFolderAction()
$path = $this->getStorage()->getSession()->getCurrentPath();
$this->getStorage()->deleteDirectory($path);
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
$result = ['error' => true, 'message' => $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()];
} else {
$result = ['error' => true, 'message' => $e->getMessage()];
}
$result = ['error' => true, 'message' => $e->getMessage()];
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
}
Expand Down Expand Up @@ -140,11 +128,7 @@ public function deleteFilesAction()
}
}
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
$result = ['error' => true, 'message' => $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()];
} else {
$result = ['error' => true, 'message' => $e->getMessage()];
}
$result = ['error' => true, 'message' => $e->getMessage()];
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
}
Expand All @@ -160,11 +144,7 @@ public function uploadAction()
$targetPath = $this->getStorage()->getSession()->getCurrentPath();
$result = $this->getStorage()->uploadFile($targetPath, $this->getRequest()->getParam('type'));
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
$result = ['errorcode' => $e->getCode(), 'error' => $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()];
} else {
$result = ['errorcode' => $e->getCode(), 'error' => $e->getMessage()];
}
$result = ['error' => true, 'message' => $e->getMessage()];
}
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public function saveAction()
} catch (Exception $e) {
$session->addException(
$e,
Mage::helper('adminhtml')->__('An error occurred while saving this configuration:') . ' ' . (Mage::getIsDeveloperMode() ? $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() : $e->getMessage())
Mage::helper('adminhtml')->__('An error occurred while saving this configuration:') . ' '
. $e->getMessage()
);
}

Expand Down
6 changes: 0 additions & 6 deletions app/code/core/Mage/Core/Model/Layout/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ public function isValid($value)
try {
$value = new Varien_Simplexml_Element('<config>' . $value . '</config>');
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
throw new Exception($e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine());
}
$this->_error(self::XML_INVALID);
return false;
}
Expand All @@ -161,9 +158,6 @@ public function isValid($value)
try {
$this->validateTemplatePath($templatePaths);
} catch (Exception $e) {
if (Mage::getIsDeveloperMode()) {
throw new Exception($e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine());
}
$this->_error(self::INVALID_TEMPLATE_PATH);
return false;
}
Expand Down

0 comments on commit 907d672

Please sign in to comment.