Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/devupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,22 @@ This page highlights the important changes that are coming in Moodle 6.0 for dev
<Since version="6.0" issueNumber="MDL-89722" />

The long-deprecated `$CFG->httpswwwroot` has been removed. It has been an alias for `$CFG->wwwroot` since Moodle 3.4, and any remaining usage in third-party code should be replaced with `$CFG->wwwroot`

## Fetch requests reject with the Response

<Since version="6.0" issueNumber="MDL-89243" />

The `core/fetch` module now rejects a failed request with its `Response` object instead of the response's status text. This gives callers access to the status, headers and body of the error response.

This is a breaking change for any code which uses the rejection reason as a string. Code which must work on both older and newer versions of Moodle can check the type of the reason:

```js
import Fetch from 'core/fetch';

Fetch.performGet('mod_example', 'animals')
.catch((reason) => {
// Moodle 6.0 and later reject with the Response. Earlier versions reject with its status text.
const message = reason instanceof Response ? reason.statusText : reason;
throw new Error(message, {cause: reason});
});
```
Loading