Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sig/react_on_rails/error.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ReactOnRails
class Error < StandardError
end
end
10 changes: 10 additions & 0 deletions sig/react_on_rails/json_parse_error.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module ReactOnRails
class JsonParseError < ::ReactOnRails::Error
attr_reader json: String

def initialize: (parse_error: StandardError, json: String) -> void
def to_honeybadger_context: () -> Hash[Symbol, untyped]
def raven_context: () -> Hash[Symbol, untyped]
def to_error_context: () -> Hash[Symbol, untyped]
end
end
21 changes: 21 additions & 0 deletions sig/react_on_rails/prerender_error.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module ReactOnRails
class PrerenderError < ::ReactOnRails::Error
MAX_ERROR_SNIPPET_TO_LOG: Integer

attr_reader component_name: String?
attr_reader err: StandardError?
attr_reader props: String?
attr_reader js_code: String?
attr_reader console_messages: String?

def initialize: (?component_name: String?, ?err: StandardError?, ?props: String?, ?js_code: String?, ?console_messages: String?) -> void
def to_honeybadger_context: () -> Hash[Symbol, untyped]
def raven_context: () -> Hash[Symbol, untyped]
def to_error_context: () -> Hash[Symbol, untyped]

private

def calc_message: (String? component_name, String? console_messages, StandardError? err, String? js_code, String? props) -> [String?, String]
def build_troubleshooting_suggestions: (String? component_name, StandardError? err, String? console_messages) -> String
end
end
28 changes: 28 additions & 0 deletions sig/react_on_rails/smart_error.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module ReactOnRails
class SmartError < Error
attr_reader error_type: Symbol
attr_reader component_name: String?
attr_reader props: String?
attr_reader js_code: String?
attr_reader additional_context: Hash[Symbol, untyped]

def initialize: (error_type: Symbol, ?component_name: String?, ?props: String?, ?js_code: String?, **untyped additional_context) -> void
def solution: () -> String

private

def build_error_message: () -> String
def error_type_title: () -> String
def error_description: () -> String
def component_not_registered_solution: () -> String
def missing_auto_loaded_bundle_solution: () -> String
def hydration_mismatch_solution: () -> String
def server_rendering_error_solution: () -> String
def redux_store_not_found_solution: () -> String
def configuration_error_solution: () -> String
def default_solution: () -> String
def additional_info: () -> String
def troubleshooting_section: () -> String
def find_similar_components: (String name) -> Array[String]
end
end