CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Core error?
Pages: [1]

Author Topic: Core error?  (Read 760 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Core error?
January 29, 2011, 11:23:26 pm
Hi,

I got a core error on a function that I had added the
Code: [Select]
try{
  } catch (PEAR_Exception $e) {
    return civicrm_create_error( $e->getMessage() );
  } catch (Exception $e) {
    return civicrm_create_error( $e->getMessage() );
  }

block to - I don't get why it isn't catching it?



Code: [Select]
Installing civicrm_tests_dev database
....F..FF<p>backTrace</p><p><pre>C:\utils\eclipseworkspace\api-civicrm\CRM\Core\
Error.php, backtrace, 270
C:\utils\eclipseworkspace\api-civicrm\CRM\Contact\BAO\RelationshipType.php, fata
l, 146
C:\utils\eclipseworkspace\api-civicrm\api\v3\RelationshipType.php, del, 149
C:\utils\eclipseworkspace\api-civicrm\tests\phpunit\api\v3\RelationshipTypeTest.
php, civicrm_relationship_type_delete, 222
, testRelationshipTypeDelete,
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestCase.
php, invokeArgs, 822
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestCase.
php, runTest, 706
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestResul
t.php, runBare, 687
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestCase.
php, run, 653
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestSuite
.php, run, 757
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\Framework\TestSuite
.php, runTest, 732
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\TextUI\TestRunner.p
hp, run, 350
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\TextUI\Command.php,
 doRun, 217
C:\utils\eclipseworkspace\api-civicrm\tools\packages\PHPUnit\TextUI\Command.php,
 run, 150
C:\utils\eclipseworkspace\api-civicrm\tools\scripts\phpunit, main, 71</pre></p><
p></p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.or
g/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <base href="" />
  <style type="text/css" media="screen">@import url(css/civicrm.css);</style>
  <style type="text/css" media="screen">@import url(css/extras.css);</style>
  <script type="text/javascript" src="js/jquery/jquery.crmaccordions.js"></scrip
t>
</head>
<body>
<div id="crm-container" lang="en" xml:lang="en">
<div class="messages status">  <div class="icon red-icon alert-icon"></div>
 <span class="status-fatal">Sorry. A non-recoverable error has occurred.</span>
    <div class="crm-section crm-error-message">Invalid relationship type</div>
            <p><a href="" title="Main Menu">Return to home page.</a></p>
</div>
</div>
<script type="text/javascript">
cj(function() {
   cj().crmaccordions();
});
</script>

</body>
</html>
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Core error?
January 30, 2011, 03:51:16 am
? on the last code sprint, we did change the handler so it would work in the api case and throw an exeption instead of dying.

How did you call that ? From the tests, right ?

(that was a bit of a struggle, really I'd avoid digging into that again ;)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Core error?
January 30, 2011, 10:40:40 am
Yes, from the tests - OK - will ignore for now....
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Core error?
January 30, 2011, 11:14:10 am
I think I spotted it

  _civicrm_initialize( true );

- the 'true'
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Core error?

This forum was archived on 2017-11-26.