views:

56

answers:

1

How do I expose errors that occur inside an IFilter to the user?

The IFilter can be loaded by a variety of Microsoft products, server products like SharePoint included. It will be separated into modules one of which is an NT service for handling indexing huge files, connection will be performed via RPC. So just anything can go wrong - permissions can be insufficicent and RPC call will fail or whatever else. Until the problem is fixed the IFilter will just not work from the consumer application point of view.

How do I at least log the error messages in some convenient way? Should I just write a log file into Windows\System32 or is there some better way?

+2  A: 

Where there is no way to communicate problems like this to the user, I've used (and often seen used) e-mail. There is great support for it in the .NET Framework and it works well.

The main thing to be careful of is to add protections to ensure users aren't spammed and mail servers don't get overloaded! In this situation or if mailing fails altogether, it's important to fall back to logging somewhere.

Also make sure to consider the audience and if it is appropriate to e-mail end users or an administrator for this particular type of message. Presumably an admin would be able to do something about it whereas a user would be confused.

Alex Angas