Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versioning to ErrorReporter methods and backfill 7.0 signatures #278

Merged
merged 1 commit into from
Nov 14, 2024
Merged
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
41 changes: 41 additions & 0 deletions rbi/annotations/activesupport.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,21 @@ class String
end

class ActiveSupport::ErrorReporter
# @version ~> 7.0.0
sig do
type_parameters(:Block, :Fallback)
.params(
error_class: T.class_of(Exception),
severity: T.nilable(Symbol),
context: T.nilable(T::Hash[Symbol, T.untyped]),
fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))),
blk: T.proc.returns(T.type_parameter(:Block)),
)
.returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback)))
end
def handle(error_class, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), &blk); end

# @version >= 7.1.0.beta1
sig do
type_parameters(:Block, :Fallback)
.params(
Expand All @@ -470,6 +485,20 @@ class ActiveSupport::ErrorReporter
end
def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end

# @version ~> 7.0.0
sig do
type_parameters(:Block)
.params(
error_class: T.class_of(Exception),
severity: T.nilable(Symbol),
context: T.nilable(T::Hash[Symbol, T.untyped]),
blk: T.proc.returns(T.type_parameter(:Block)),
)
.returns(T.type_parameter(:Block))
end
def record(error_class, severity: T.unsafe(nil), context: T.unsafe(nil), &blk); end

# @version >= 7.1.0.beta1
sig do
type_parameters(:Block)
.params(
Expand All @@ -483,6 +512,18 @@ class ActiveSupport::ErrorReporter
end
def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end

# @version ~> 7.0.0
sig do
params(
error: Exception,
handled: T::Boolean,
severity: T.nilable(Symbol),
context: T::Hash[Symbol, T.untyped],
).void
end
def report(error, handled:, severity: T.unsafe(nil), context: T.unsafe(nil)); end

# @version >= 7.1.0.beta1
sig do
params(
error: Exception,
Expand Down
Loading