इधरफेंको
Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.
Throws a recoverable error.
Syntax: इधरफेंको <expression>
Category#
errors
Related#
Examples#
radix/corpus/iace/iace-si-guard.fab (canonical · keyword)#
Conditional throw with यदि guard.
# =============================================================================
# इधरफेंको — Conditional throw with यदि guard
# =============================================================================
#
# What this teaches:
# • Conditional throw with यदि guard.
# • Related keywords: पकड़ो, मरोजाओ, यदि, ⇥
#
# Common mistakes:
# • Using `इधरफेंको यदि` without a `⇥` on the enclosing function or a `करो/cape` wrapper — the guard sugar expands to `यदि cond { इधरफेंको val }`, which still needs an error context.
#
# See also: पकड़ो, मरोजाओ, यदि, ⇥
# =============================================================================
# इधरफेंको with optional यदि guard
#
# इधरफेंको <value> [यदि <condicio>]
#
# GRAMMAR:
# throwStmt :← 'इधरफेंको' expr ['यदि' expr]
#
# The optional `यदि` guard is parser sugar:
# इधरफेंको val यदि cond → यदि cond { इधरफेंको val }
#
# Without the guard, इधरफेंको is unconditional (unchanged).
#
# EXPECTED OUTPUT:
# "ok: valid input"
# "caught: empty input"
# "caught: negative"
fn validata(string input) → string ⇥ string {
# Guard: throw if input is empty
throw "empty input" if input.length() ≡ 0
return "valid: §"(input)
}
main {
# Happy path — guard not triggered
do {
const string a ← validata("hello")
print "ok: §"(a)
}
catch err {
print "unexpected: §"(err)
}
# Empty input — इधरफेंको यदि guard triggers
do {
const string b ← validata("")
print "should not reach"
}
catch err {
print "caught: §"(err)
}
# इधरफेंको with यदि on same line
do {
throw "force throw" if true
print "should not reach"
}
catch err {
print "caught: §"(err)
}
}radix/corpus/iace/iace.fab (canonical · keyword)#
Throws a recoverable error.
# =============================================================================
# इधरफेंको — Throws a recoverable error
# =============================================================================
#
# What this teaches:
# • Throws a recoverable error.
# • Related keywords: ⇥, पकड़ो, मरोजाओ, लौटाओ
#
# Common mistakes:
# • Using `इधरफेंको` without a `⇥` on the enclosing function or a `करो { ... } पकड़ो err { ... }` wrapper — `इधरफेंको` requires an error-handling context (SEM010).
#
# See also: ⇥, पकड़ो, मरोजाओ, लौटाओ
# =============================================================================
# इधरफेंको — recoverable throw and पकड़ो handler
#
# इधरफेंको <value>
# करो { <body> }
# पकड़ो err { <handler> }
#
# GRAMMAR:
# throwStmt :← 'इधरफेंको' expr
# facStmt :← 'करो' block catchClause?
#
# EXPECTED OUTPUT:
# Caught error messages from करो/cape recovery paths.
#
# BACKEND:
# Rust/Go lowering does not emit इधरफेंको/cape yet — compile-only smoke.
main {
# Bare इधरफेंको with पाठ payload
do {
throw "Something went wrong"
}
catch err {
print "Caught:", err
}
# इधरफेंको with interpolated message
const int code ← 404
do {
throw "Error code: §"(code)
}
catch err {
print "Caught:", err
}
# Conditional इधरफेंको inside करो — validation guard
const int value ← -5
do {
if value ≺ 0 {
throw "Value must be non-negative"
}
print "Value is valid"
}
catch err {
print "Validation failed:", err
}
}Expected output:
Caught: Something went wrong
Caught: Error code: 404
Validation failed: Value must be non-negative