Use multiple catch statements

http://ideone.com/S70bSQ