You should probably use a separate kind of exception here instead of string parsing. You never know when someone will add 'timeout' to another exception message.