Skip to content

Error on ms_outlook_email$move() #221

@sambtalcott

Description

@sambtalcott

I have an email object from the inbox that I am trying to archive using $move(). The move operation completes successfully, however the on.exit(self$sync_fields()) throws an error after the fact.

My code:

ol <- Microsoft365R::get_business_outlook()
ems <- ol$get_inbox()$list_emails(search = "subject:Example")
em <- ems[[1]]
em$move(ol$get_folder("Archive"))
#> Error in process_response(res, match.arg(http_status_handler), simplify) : 
#>   Not Found (HTTP 404). Failed to complete operation. Message:
#> The specified object was not found in the store., The process failed to get the correct properties.

Given that the move itself works fine and I don't need the email object afterwards I'm just suppressing the error with tryCatch() (see below if you need a workaround), but ideally it wouldn't be thrown at all.

tryCatch(
  em$move(ol$get_folder("Archive")), 
  error = \(e) {
    if (!grepl("failed to get the correct properties", e$message)) stop(e)
  }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions