---
id: change/bcapps/8742
type: change
title: "#8742 Enhance SharePoint error handling and add tests"
summary: SharePoint error handling now correctly parses OData verbose error responses to show meaningful error messages instead of empty strings. The parser falls back gracefully to OAuth token error format and raw body when needed.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit sharepoint operation response
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:12:38.189Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5c3faab1c694647d331e95f858961d69abdc9081
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/8742
    title: "microsoft/BCApps#8742: Enhance SharePoint error handling and add tests"
    date: "2026-07-14"
    commit: 5c3faab1c694647d331e95f858961d69abdc9081
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/9108
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 8742
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/8742
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-14T17:42:26Z"
author: glachana
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - "AL: System Application"
  - From Fork
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 79
  deletions: 4
  al: 1
apps:
  - System Application
objects_touched:
  - key: codeunit/9108
    page: codeunit/9108
    type: codeunit
    id: 9108
    name: SharePoint Operation Response
    app: System Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues:
  - 8476
work_items:
  - 641594
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #8742 Enhance SharePoint error handling and add tests

> SharePoint error handling now correctly parses OData verbose error responses to show meaningful error messages instead of empty strings. The parser falls back gracefully to OAuth token error format and raw body when needed.

[Pull request](https://github.com/microsoft/BCApps/pull/8742) · merged into `main` (BC30) on 2026-07-14 by glachana (community contribution) · 3 files (+79 -4), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fixes empty error messages from SharePoint REST API failures by parsing OData v3 verbose response format (error.message.value)
- Maintains backward compatibility with OAuth token error shape (error_description) as a fallback
- Supports OData v4 plain-string error format and malformed bodies
- Added unit tests for all error response formats
- No changes to public API or request construction
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 9108 "SharePoint Operation Response"](../../objects/codeunit/9108.md), System Application: modified

## Context

- Fixes: [#8476 [Bug]: SharePoint Client returns empty error messages (GetErrorDescription parses 'error_description' instead of OData verbose 'error.message.value')](https://github.com/microsoft/BCApps/issues/8476) (closed)
- Work items: AB#641594
- Labels: ADO: Sync, AL: System Application, From Fork, Team: Integrations
- Systems: integration

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
