Whenever a script value is checked for error, also check for exception.

So when writing project files, people are not forced to wrap their
exception message in an error object.

Change-Id: I6168b0fd1f8bc137d13185440b9fd3b08c8ea1a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>