Changed the error type to polymorphic variant.