Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the error message in DeletingFailedException more descriptive #453

Open
Liiva opened this issue May 17, 2018 · 2 comments
Open

Make the error message in DeletingFailedException more descriptive #453

Liiva opened this issue May 17, 2018 · 2 comments

Comments

@Liiva
Copy link

Liiva commented May 17, 2018

Currently in DeletingFailedException line 52 an error message is created:

We encountered 1 problem while trying to delete the saved models.  

This (incorrectly) let me to believe the cleanup failed, possibly because of foreign key constraint violations. It would be more useful to show the actual exception messages as in my case the actual error was:

The EntityManager is closed.
@Liiva
Copy link
Author

Liiva commented Apr 24, 2020

Just for future reference if anyone hits this via a Google search, to troubleshoot the actual messages:

  • Make sure the DataFactory module is defined before your ORM module, see snippet below.
  • If you errors are database constraint violations, enable the Codeception Logger to see the actual error message in your log files (e.g. tests/_output/unit-2020-04-24 for unit tests)
  • If all else fails, dump the exception messages in vendor/league/factory-muffin/src/Stores/AbstractStore.php
actor: UnitTester
modules:
    enabled:
        - Symfony:
            app_path: 'app'
            environment: 'test'
        # important, must be defined _before_ Doctrine2 module
        - DataFactory:
            depends: Doctrine2
        - Doctrine2:
            depends: Symfony
            cleanup: false

@oyepez003
Copy link

oyepez003 commented Apr 23, 2023

Just for future reference if anyone hits this via a Google search, to troubleshoot the actual messages:

* Make sure the DataFactory module is defined **before** your ORM module, see snippet below.

* If you errors are database constraint violations, enable the [Codeception Logger](https://codeception.com/extensions#Logger) to see the actual error message in your log files (e.g.  `tests/_output/unit-2020-04-24` for unit tests)

* If all else fails, dump the exception messages in `vendor/league/factory-muffin/src/Stores/AbstractStore.php`
actor: UnitTester
modules:
    enabled:
        - Symfony:
            app_path: 'app'
            environment: 'test'
        # important, must be defined _before_ Doctrine2 module
        - DataFactory:
            depends: Doctrine2
        - Doctrine2:
            depends: Symfony
            cleanup: false

Thanks @Liiva This comment should be in the module's documentation!.

https://codeception.com/docs/modules/DataFactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants