{"record":{"id":"a4c10c877b249139","repo":"onetimesecret/onetimesecret","slug":"no-sample-data-found-path","errorCode":null,"errorMessage":"No sample data found: #{path}","messagePattern":"No sample data found: #(.+?)","errorType":"validation","errorClass":"Onetime::Operations::Email::PreviewTemplate::MissingSampleError","httpStatus":422,"severity":"error","filePath":"lib/onetime/operations/email/preview_template.rb","lineNumber":126,"sourceCode":"          @format == 'html'\n        end\n\n        # Mirror the CLI's load_data / load_sample_data exactly so preview output is\n        # identical whether invoked over HTTP or on a shell.\n        def resolve_data\n          if @data\n            symbolized                   = @data.transform_keys(&:to_sym)\n            symbolized[:recipient]     ||= 'preview@example.com'\n            symbolized[:email_address] ||= symbolized[:recipient]\n            symbolized\n          else\n            load_sample_data\n          end\n        end\n\n        def load_sample_data\n          sample_file = File.join(SAMPLES_PATH, \"#{@template}.yml\")\n          raise MissingSampleError, sample_file unless File.exist?(sample_file)\n\n          parsed                       = YAML.safe_load_file(sample_file, permitted_classes: [Symbol])\n          symbolized                   = parsed.transform_keys(&:to_sym)\n          symbolized[:recipient]     ||= symbolized.delete(:email_address) || 'preview@example.com'\n          symbolized[:email_address] ||= symbolized[:recipient]\n          symbolized\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":108,"sourceCodeEnd":138,"githubUrl":"https://github.com/onetimesecret/onetimesecret/blob/f81295e41bc3e808a3dd2cbea03ef65401a662e4/lib/onetime/operations/email/preview_template.rb#L108-L138","documentation":"Error \"No sample data found: #{path}\" thrown in onetimesecret/onetimesecret.","triggerScenarios":"Thrown at lib/onetime/operations/email/preview_template.rb:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the sample data path exists and is readable; correct the path or provide the missing sample file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f81295e41bc3e808a3dd2cbea03ef65401a662e4","analyzedAt":"2026-08-23T21:13:10.635Z","schemaVersion":2},"datasetVersion":"2026-08-24T02:17:37.098Z"}