onetimesecret/onetimesecret · error · Onetime::Problem

Invalid border radius - must be a preset (#{BrandSettingsCon

Error message

Invalid border radius - must be a preset (#{BrandSettingsConstants::RADII.join(', ')}) or a whole number of pixels 0-#{BrandSettingsConstants::RADIUS_MAX}

What it means

Error "Invalid border radius - must be a preset (#{BrandSettingsConstants::RADII.join(', ')}) or a whole number of pixels 0-#{BrandSettingsConstants::RADIUS_MAX}" thrown in onetimesecret/onetimesecret.

Source

Thrown at lib/onetime/models/custom_domain/brand_settings.rb:312

        return if valid_font?(normalized[:heading_font])

        raise Onetime::Problem, "Invalid heading font - must be one of: #{BrandSettingsConstants::FONTS.join(', ')}"
      end

      # @api private
      def self.validate_corner_style_field!(normalized)
        return unless normalized.key?(:corner_style) && !normalized[:corner_style].nil?
        return if valid_corner_style?(normalized[:corner_style])

        raise Onetime::Problem, "Invalid corner style - must be one of: #{BrandSettingsConstants::CORNERS.join(', ')}"
      end

      # @api private
      def self.validate_border_radius_field!(normalized)
        return unless normalized.key?(:border_radius) && !normalized[:border_radius].nil?
        return if valid_border_radius?(normalized[:border_radius])

        raise Onetime::Problem,
          "Invalid border radius - must be a preset (#{BrandSettingsConstants::RADII.join(', ')}) " \
          "or a whole number of pixels 0-#{BrandSettingsConstants::RADIUS_MAX}"
      end

      # @api private
      #
      # Write-path validation for PER-DOMAIN (tenant-uploaded) settings only:
      # https or app-relative. The install-wide brand.logo_url is a separate,
      # more permissive surface — the mail renderer gates it to absolute
      # http(s) at render time (Mail::Views TemplateContext#logo_url) and the
      # web UI accepts relative paths. The two policies intentionally differ.
      def self.validate_url_fields!(normalized)
        [:logo_url, :logo_dark_url, :favicon_url].each do |url_field|
          next unless normalized.key?(url_field) && !normalized[url_field].nil?
          next if valid_url?(normalized[url_field])

          raise Onetime::Problem, "Invalid #{url_field.to_s.tr('_', ' ')} - must be https:// URL or relative path starting with /"
        end

View on GitHub (pinned to f81295e41b)

Solutions

  1. Use one of the preset radii or a whole number of pixels within the allowed range shown in the message.

When it happens

Trigger: Thrown at lib/onetime/models/custom_domain/brand_settings.rb:312 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of onetimesecret/onetimesecret@f81295e41b (2026-08-23). Data as JSON: /api/errors/aa3dd992daef0077. Report an issue: GitHub.