JERROR-CLASS-001

JError::raiseError()

JError / JException

JError was Joomla's old error stack. It was deleted in Joomla 4. Compatibility plugins do not restore it. Keep using PHP exceptions.

JError::raiseError()throw new RuntimeException() / try-catch

Dies at Joomla 3 → 4J3: Works nativelyJ4: Removed — fatalJ6: Removed — fatalBC plugin: no — already dead on J4Architecture change — no auto-fixJoomla API

What you will see

  • Class "JError" not found
  • Class "JException" not found

Symptoms people search

500 after save · error handling exploded on Joomla 4

Replace this code

Swap JError::raiseError() for throw new RuntimeException() / try-catch.

Joomla 3

Remove or stop calling this

JError::raiseError(500, 'Could not save');
$this->setError($db->getErrorMsg());

Joomla 4 / 6

Use this instead

throw new \RuntimeException('Could not save');
// Catch at the controller and enqueue a message

How to fix it

  1. 1Delete JError::raise* calls.
  2. 2Throw RuntimeException (or a domain exception) instead of setError().
  3. 3In controllers, catch and $app->enqueueMessage().

Also known as

JError · JException · raiseError · setError

There is no 1:1 swap for this one. The architecture changed. If you cannot rewrite it, Infyways can.

Related issues

Get in touch

Have a project in mind? Let's talk about it.

Tell us what you're building. Whether it's a new site, an online store, a mobile app, or something that needs AI under the hood, we'll get back to you within a business day.

Free consultation
No commitment, no pressure
Reply within 24 hours
Usually much faster

Prefer a direct conversation?

Request a project quote

Tell us about your project

Fill out the quick form and we'll reach out.