Skip to content

feat: new config property propagateErrors#204

Merged
AleksandrRogov merged 1 commit into
devfrom
feature/propagate-errors-config-options
Apr 25, 2026
Merged

feat: new config property propagateErrors#204
AleksandrRogov merged 1 commit into
devfrom
feature/propagate-errors-config-options

Conversation

@AleksandrRogov

Copy link
Copy Markdown
Owner

Introducing a new global config option propagateErrors.

This option is related to a raised issue #203 where you can find more information behind this change. Main things that will need to be noted here is the following:

  • This option is temporary. Meaning, it will be available until the next major version and will be removed then.
  • This option is introduced to standardize the behavior of all requests and it is recommended that you set it to true in all new projects using DynamicsWebApi so all requests have expected behaivor. Usage of propagateErrors is optional.
  • For existing projects, if you set propagateErrors to true - watch out for the following operations: update, upsert and deleteRecord. Those requests will now throw errors instead of handling 412 and 404 errors.

Example:

const dynamicsWebApi = new DynamicsWebApi({
    serverUrl: "https://myorg.api.crm.dynamics.com",
    onTokenRefresh: acquireToken,
    propagateErrors: true
});

// the following will now throw an error if a contact with <KEY> exists instead of returning "false"
await dynamicsWebApi.update({
    collection: "contacts",
    key: "<KEY>",
    data: { firstname: "John" }
});

⚠️ Deprecation Notice

Error handling of 404 and 412 errors is now treated as legacy and will be removed in update, upsert and deleteRecord operations to standardize the request behavior.

@AleksandrRogov AleksandrRogov self-assigned this Apr 25, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.767% (+0.4%) from 98.334% — feature/propagate-errors-config-options into dev

@AleksandrRogov AleksandrRogov merged commit 1de7d21 into dev Apr 25, 2026
11 checks passed
@AleksandrRogov AleksandrRogov linked an issue Apr 25, 2026 that may be closed by this pull request
@AleksandrRogov AleksandrRogov deleted the feature/propagate-errors-config-options branch April 25, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

412 errors are treated differently than other errors

2 participants