Updated TriangleError to inherit from Exception.