Skip to content

RBS: Add type signatures for error classes #1954

@justin808

Description

@justin808

Summary

Add RBS type signatures for error-related classes to complete type coverage.

Missing Classes

Currently these classes lack RBS signatures:

  1. ReactOnRails::Error
  2. ReactOnRails::JsonParseError
  3. ReactOnRails::PrerenderError
  4. ReactOnRails::SmartError

Implementation Files

  • lib/react_on_rails/error.rb
  • lib/react_on_rails/json_parse_error.rb
  • lib/react_on_rails/prerender_error.rb
  • lib/react_on_rails/smart_error.rb

Proposed Signatures

# sig/react_on_rails/error.rbs
module ReactOnRails
  class Error < StandardError
  end
end

# sig/react_on_rails/prerender_error.rbs
module ReactOnRails
  class PrerenderError < Error
    def initialize: (
      component_name: String,
      props: String?,
      err: StandardError?,
      js_code: String?,
      ?console_messages: String?
    ) -> void
    
    attr_reader component_name: String
    attr_reader props: String?
    attr_reader err: StandardError?
    attr_reader js_code: String?
  end
end

Scope

This was intentionally excluded from PR #1945 to focus on public API coverage. This issue tracks adding these internal/error types.

Priority

Low - Error classes are used internally and type coverage for public API is complete.

Related

Follow-up to PR #1945

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions