{"record":{"id":"37050990cf9ea022","repo":"emberjs/ember.js","slug":"formatmessage-message","errorCode":null,"errorMessage":"${formatMessage(message)}","messagePattern":"\\$\\{formatMessage\\(message\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/@ember/debug/lib/deprecate.ts","lineNumber":166,"sourceCode":"          }\n\n          stackStr = `\\n    ${stack.slice(2).join('\\n    ')}`;\n        }\n      }\n\n      let updatedMessage = formatMessage(message, options);\n\n      console.warn(`DEPRECATION: ${updatedMessage}${stackStr}`); // eslint-disable-line no-console\n    } else {\n      next(message, options);\n    }\n  });\n\n  registerHandler(function raiseOnDeprecation(message, options, next) {\n    if (ENV.RAISE_ON_DEPRECATION) {\n      let updatedMessage = formatMessage(message);\n\n      throw new Error(updatedMessage);\n    } else {\n      next(message, options);\n    }\n  });\n\n  missingOptionsDeprecation =\n    'When calling `deprecate` you ' +\n    'must provide an `options` hash as the third parameter.  ' +\n    '`options` should include `id` and `until` properties.';\n  missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.';\n\n  missingOptionDeprecation = (id: string, missingOption: string): string => {\n    return `When calling \\`deprecate\\` you must provide \\`${missingOption}\\` in options. Missing options.${missingOption} in \"${id}\" deprecation`;\n  };\n  /**\n   @module @ember/debug\n   @public\n   */","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@ember/debug/lib/deprecate.ts#L148-L184","documentation":"Ember's deprecate() system allows raising instead of warning: when ENV.RAISE_ON_DEPRECATION is true, the default handler throws an Error whose message is the formatted deprecation message, turning deprecation warnings into hard failures.","triggerScenarios":"Calling deprecate(msg, ...) (or triggering framework deprecations) while config sets RAISE_ON_DEPRECATION to true (commonly set in tests to enforce no-deprecation policies).","commonSituations":"CI test suites configured to fail on deprecations (Ember CLI QUnit hooks); running app code that uses a deprecated API in an environment with raise-on-deprecation enabled.","solutions":["Update code to stop using the deprecated API named in the message","Set RAISE_ON_DEPRECATION to false if you only want warnings","Filter/ignore specific deprecations with options.id handling via a custom handler"],"exampleFix":"// config/environment.js\n// before\nENV.RAISE_ON_DEPRECATION = true;\n// after\nENV.RAISE_ON_DEPRECATION = false; // or fix the deprecated API usage","handlingStrategy":"validation","validationCode":"import { isTesting, registerDeprecationHandler } from '@ember/debug';\n// ensure ENV.RAISE_ON_DEPRECATION reflects your intent before app load\nif (config.environment === 'test') { /* decide raise vs warn */ }","typeGuard":"null","tryCatchPattern":"try { deprecatedApi(); } catch (e) { if (isDeprecationError(e)) logDeprecation(e.message); else throw e; }","preventionTips":["Keep RAISE_ON_DEPRECATION false unless running strict deprecation CI","Fix deprecated API usage flagged in the message promptly","Register a custom deprecation handler to filter by options.id","Audit app for deprecations before enabling raise-on-deprecation"],"tags":["ember","deprecation","configuration","raise-on-deprecation"],"backgroundTag":"raise-on-deprecation","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}