tests: imap test for exception handler returns value