{"record":{"id":"ad5eff8b372e94c5","repo":"instructure/canvas-lms","slug":"missing-term","errorCode":null,"errorMessage":"missing term","messagePattern":"missing term","errorType":"exception","errorClass":"ActionController::BadRequest","httpStatus":400,"severity":"error","filePath":"app/controllers/jobs_v2_controller.rb","lineNumber":459,"sourceCode":"\n  # @{not an}API Test throttle search term\n  #\n  # @argument term [Required, String]\n  #   The search term. Will find unstranded queued jobs whose tags start with this term.\n  #\n  # @argument shard_id [Optional, Integer]\n  #   If given, limit search to jobs on this shard\n  #\n  # @example_response\n  #   {\n  #     matched_jobs: 103,\n  #     matched_tags: 7\n  #   }\n  #\n  def throttle_check\n    GuardRail.activate(:secondary) do\n      term = params[:term]\n      raise ActionController::BadRequest, \"missing term\" unless term.present?\n\n      scope = throttle_scope(term, params[:shard_id])\n      render json: {\n        matched_jobs: scope.count,\n        matched_tags: scope.distinct.count(:tag)\n      }\n    end\n  end\n\n  # @{not an}API Throttle jobs with a specific tag pattern by stranding them\n  #\n  # @argument term [Required, String]\n  #   The search term. Unstranded queued jobs whose tags start with this term\n  #   (case sensitively) will be throttled.\n  #\n  # @argument shard_id [Optional, Integer]\n  #   If given, limit to jobs on this shard\n  #","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/controllers/jobs_v2_controller.rb#L441-L477","documentation":"Guard in JobsV2Controller#throttle_check: the required 'term' parameter is missing or blank when calling the throttle search endpoint, so ActionController::BadRequest is raised instead of running the job-tag query.","triggerScenarios":"Thrown at app/controllers/jobs_v2_controller.rb:459 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the required term parameter (tag prefix to search for)","Check the client/UI is sending the search term with the request"],"exampleFix":null,"handlingStrategy":"validation","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"}