xp-framework/rfc — Issue #14: Dynamic exception loading
Author: thekid
Created: 2011-10-17 15:31:00+00:00
State: closed
Labels: framework, implemented

Scope of Change
====
A new core function raise() will be introduced.

Rationale
====
Loading all exceptions statically (by means of uses()) can impose
performance penalties.

Functionality
====

Prototype:

```
xp.null raise(string classname, string message) throws Throwable;

```

Example:

```php
printStackTrace();
}
?>
```

Implementation:

```php
getMessage());
// Bails out
}

return throw($class->newInstance($message));
}
?>
```

Dependencies
====
None.

Related documents
====
- Pascal raise statement
http://www.freepascal.org/docs-html/ref/refse65.html#x150-15700013.1