Skip to content

Bug report: unhandled exception when trying to move file from non-existent location #4537

@waldekmastykarz

Description

@waldekmastykarz

Description

When trying to use the spo file move command to move file from a non-existent location, we seem to be throwing an unhandled exception.

Steps to reproduce

m365 spo file move -u / -s Shared%Documents/non-existent-file.zip -t /sites/retail/Shared%20Documents

Expected results

Humand-readable error

Actual results

node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^
[AxiosError: Request failed with status code 404] {
  code: 'ERR_BAD_REQUEST',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: Infinity,
    maxBodyLength: Infinity,
    env: {
      FormData: [Function: FormData] {
        LINE_BREAK: '\r\n',
        DEFAULT_CONTENT_TYPE: 'application/octet-stream'
      }
    },
//... trimmed for brevity

Diagnostics

No response

CLI for Microsoft 365 version

Latest from main

nodejs version

v16.13.0

Operating system (environment)

macOS

Shell

zsh

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions