{"record":{"id":"111431ccb1733266","repo":"instructure/canvas-lms","slug":"test-error","errorCode":null,"errorMessage":"test_error","messagePattern":"test_error","errorType":"exception","errorClass":"ActionController::InvalidAuthenticityToken","httpStatus":422,"severity":"error","filePath":"app/controllers/info_controller.rb","lineNumber":126,"sourceCode":"  end\n\n  # for windows live tiles\n  def browserconfig\n    cancel_cache_buster\n    expires_in 10.minutes, public: true\n  end\n\n  def test_error\n    @context = Course.find(params[:course_id]) if params[:course_id].present?\n\n    if params[:status].present?\n      case params[:status].to_i\n      when 401\n        @unauthorized_reason = :unpublished if params[:reason] == \"unpublished\"\n        @needs_cookies = true if params[:reason] == \"needs_cookies\"\n        return render_unauthorized_action\n      when 422\n        raise ActionController::InvalidAuthenticityToken, \"test_error\"\n      else\n        @not_found_message = \"(test_error message details)\" if params[:message].present?\n        raise RequestError.new(\"test_error\", params[:status].to_i)\n      end\n    end\n\n    render status: :not_found, template: \"shared/errors/404_message\"\n  end\n\n  def live_events_heartbeat\n    Canvas::LiveEvents.heartbeat\n    render plain: \"heartbeat event sent at #{Time.now.utc.iso8601}\"\n  end\n\n  def web_app_manifest\n    # brand_variable returns a value that we expect to go through a rails\n    # asset helper, so we need to do that manually here\n    icon = helpers.image_path(brand_variable(\"ic-brand-apple-touch-icon\"))","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/controllers/info_controller.rb#L108-L144","documentation":"Intentional test error: InfoController#test_error raises ActionController::InvalidAuthenticityToken with the literal message 'test_error' when params[:status] resolves to 422. This is a diagnostic endpoint for exercising Canvas's error rendering/reporting pipeline, not a real failure.","triggerScenarios":"Thrown at app/controllers/info_controller.rb:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["If seen unintentionally, nothing to fix — the endpoint was deliberately called","Avoid calling /info/test_error?status=422 in production traffic"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}