improve Celery file system error handling

Issue #112 resolved
Ed McDonagh created an issue

Celery currently crashes effectively if a file cannot be written or deleted.

Comments (13)

  1. Ed McDonagh reporter

    Added try except routine around temporary file creation in main csv export routines. Need to replicate for CT xlsx and for NHSBSP Mammo csv. Can test routines still work, but not sure if can test the new function as I don't know where the temp files are stored. Refs #112

    → <<cset b6bacacb166d>>

  2. Ed McDonagh reporter

    Wrapped xlsx save in a try to catch file errors. Added messages import to show error message to user, but will probably end up using django-async-messages as this is a celery job. Or not use messaging at all. Refs #112.

    → <<cset 27e1efc3bd15>>

  3. Ed McDonagh reporter

    Added try-except-message to progress field to the csv export routines. Need to copy to mammo NHSBSP csv. Need to try and get a more useful error message. Refs #112.

    → <<cset ea872c35b175>>

  4. Ed McDonagh reporter

    Added in exception for OSError to get more useful feedback about what the problem was. Also stopped trying to redirect to a URL, as this is an asynchronous task and that doesn't make sense - it was also sending the celery server into a sea of red error messages. Refs #112.

    → <<cset 861991d28d11>>

  5. Ed McDonagh reporter

    Applied same try-except OSError-except code as for the csv exports and tested. Also tested with no file-permission errors, and everything still works. Refs #112.

    → <<cset 5ed17aebcc83>>

  6. Ed McDonagh reporter

    Log file creation errors are now caught for size imports, the error category is passed to the view and the view displays them. Abort, delete error import and delete don't seem to work, probably unrelated. Refs #112

    → <<cset fb5b84d5cc53>>

  7. Log in to comment