node_test_exception.module 306 B

123456789101112131415
  1. <?php
  2. /**
  3. * @file
  4. * A module implementing node related hooks to test API interaction.
  5. */
  6. /**
  7. * Implements hook_node_insert().
  8. */
  9. function node_test_exception_node_insert($node) {
  10. if ($node->title == 'testing_transaction_exception') {
  11. throw new Exception('Test exception for rollback.');
  12. }
  13. }