Language: Python
Label: safe
CWE: CWE-209 \u2014 Generation of Error Message Containing Sensitive Information
The product generates an error message that includes sensitive information about its environment, users, or associated data.

Code:
    def mutate(cls, root, info: ResolveInfo, **data):
        disallow_replica_in_context(info.context)
        try:
            setup_context_user(info.context)
        except jwt.InvalidTokenError:
            return cls.handle_errors(
                ValidationError(
                    "Invalid token", code=AccountErrorCode.JWT_INVALID_TOKEN.value
                )
            )

        if not cls.check_permissions(info.context, data=data):
            raise PermissionDenied(permissions=cls._meta.permissions)
        manager = get_plugin_manager_promise(info.context).get()
        result = manager.perform_mutation(
            mutation_cls=cls, root=root, info=info, data=data
        )
        if result is not None:
            return result

        try:
            response = cls.perform_mutation(root, info, **data)
            if response.errors is None:
                response.errors = []
            return response
        except ValidationError as e:
            return cls.handle_errors(e)