Switching error packages and using predefined errors