diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/resources/resource.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/core/resources/resource.controller.ts index 44ae915af3..24e142c6f1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/resources/resource.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/resources/resource.controller.ts @@ -12,6 +12,7 @@ import { CancelError, type ProblemDetails, } from '@umbraco-cms/backoffice/external/backend-api'; +import { UmbDeprecation } from '../utils/deprecation/deprecation.js'; export class UmbResourceController extends UmbControllerBase { #promise: Promise; @@ -48,11 +49,20 @@ export class UmbResourceController extends UmbControllerBase { /** * Wrap the {tryExecute} function in a try/catch block and return the result. * If the executor function throws an error, then show the details in a notification. - * @param options + * @param _options */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars async tryExecuteAndNotify(options?: UmbNotificationOptions): Promise> { const { data, error } = await UmbResourceController.tryExecute(this.#promise); + if (options) { + new UmbDeprecation({ + deprecated: 'tryExecuteAndNotify `options` argument is deprecated.', + removeInVersion: '17.0.0', + solution: 'Use the method without arguments.', + }).warn(); + } + if (error) { /** * Determine if we want to show a notification or just log the error to the console.