wrapped getTypeName() in a try/catch block as its using might result in TypeErrors

We noticed some strange TypeErrors ([TypeError: Cannot read property 'constructor' of undefined]) as we started using traceback. We figured that it's 'use strict'; whats causing these errors.

So wrapping the call in a try/catch block solves these errors.