Error types in javascript need to be wrapped in a way that their interface is .NET-like. This is needed to support catching native javascript errors with .NET catch clauses. These wrapped types should be derived from System.Exception so that a catch(Exception) will properly catch all exceptions.