Change the interface of CanHandle to return error information.

I think this should should help improve robustness and give better error feedback.