Migrate functions to Error