{"record":{"id":"f7ae90e4b1dec258","repo":"instructure/canvas-lms","slug":"set-type-set-type-is-not-supported-supported-types-are","errorCode":null,"errorMessage":"Set type '%{set_type}' is not supported. Supported types are: %{supported_types}","messagePattern":"Set type '%(.+?)' is not supported\\. Supported types are: %(.+?)","errorType":"validation","errorClass":"PeerReview::SetTypeNotSupportedError","httpStatus":null,"severity":"error","filePath":"app/services/peer_review/validations.rb","lineNumber":227,"sourceCode":"\n  def validate_course_exists(course)\n    raise PeerReview::CourseNotFoundError, I18n.t(\"Course does not exist\") unless course.present?\n  end\n\n  def validate_student_ids_required(student_ids)\n    if student_ids.nil? || student_ids == \"\" || student_ids.to_s.strip.empty? || (student_ids.is_a?(Array) && student_ids.empty?)\n      raise PeerReview::StudentIdsRequiredError, I18n.t(\"Student ids are required\")\n    end\n  end\n\n  def validate_student_ids_in_course(student_ids)\n    raise PeerReview::StudentIdsNotInCourseError, I18n.t(\"Student ids are not in course\") if student_ids.blank?\n  end\n\n  def validate_set_type_supported(set_type, services)\n    unless services.key?(set_type)\n      supported_types = services.keys.join(\", \")\n      raise PeerReview::SetTypeNotSupportedError,\n            I18n.t(\"Set type '%{set_type}' is not supported. Supported types are: %{supported_types}\", set_type:, supported_types:)\n    end\n  end\n\n  def validate_group_assignment_required(assignment)\n    unless assignment.group_category_id\n      raise PeerReview::GroupAssignmentRequiredError, I18n.t(\"Must be a group assignment to create group overrides\")\n    end\n  end\n\n  def validate_group_exists(group)\n    raise PeerReview::GroupNotFoundError, I18n.t(\"Group does not exist\") unless group.present?\n  end\n\n  def validate_adhoc_parent_override_exists(parent_override, student_ids)\n    unless parent_override.present?\n      raise PeerReview::ParentOverrideNotFoundError,\n            I18n.t(\"Parent assignment ADHOC override not found for students %{student_ids}\", student_ids: student_ids.join(\", \"))","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/services/peer_review/validations.rb#L209-L245","documentation":"PeerReview::SetTypeNotSupportedError raised by validate_set_type_supported when set_type is not a key in the services hash. The message interpolates the offending set_type and the list of supported keys.","triggerScenarios":"Calling a peer review service with set_type not registered in the services map — e.g. 'groups' when only 'group' is registered, a plugin providing a set type that is not enabled, or a typo/renamed key.","commonSituations":"Typo or singular/plural mismatch in set_type; newer/older versions where the service registry differs; disabling a plugin removed a supported type the client still sends.","solutions":["Use one of the supported set_type values listed in the message","Check the services registry in the peer review service to see registered keys","Upgrade/enable the plugin or service that provides the desired set type"],"exampleFix":"// before\nservice.call(set_type: 'groups', set_id: 7)   # not registered\n// after\nservice.call(set_type: 'group', set_id: 7)    # matches services key","handlingStrategy":"validation","validationCode":"supported = PeerReview::ServiceRegistry.services.keys\nraise ArgumentError, \"set_type must be one of #{supported.join(', ')}\" unless supported.include?(params[:set_type])","typeGuard":null,"tryCatchPattern":"begin\n  service.call(set_type:)\nrescue PeerReview::SetTypeNotSupportedError => e\n  render json: { error: e.message }, status: :bad_request\nend","preventionTips":["Source set_type options in the UI from the services registry, not hardcoded lists","Reuse exact registry keys (mind singular/plural)","Re-check supported set types after plugin enable/disable or version upgrades"],"tags":["ruby","peer-review","invalid-enum-value","canvas"],"backgroundTag":"invalid-enum-value","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"}