Skip to content

Commit 5d6b2e5

Browse files
committed
throw spacemismatch
1 parent 9f139d0 commit 5d6b2e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tensors/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ for f in (:cos, :sin, :tan, :cot, :cosh, :sinh, :tanh, :coth, :atan, :acot, :asi
444444
sf = string(f)
445445
@eval function Base.$f(t::AbstractTensorMap)
446446
domain(t) == codomain(t) ||
447-
error("$sf of a tensor only exist when domain == codomain.")
447+
throw(SpaceMismatch("`$($sf)` of a tensor only exist when domain == codomain"))
448448
T = float(scalartype(t))
449449
tf = similar(t, T)
450450
if T <: Real
@@ -464,7 +464,7 @@ for f in (:sqrt, :log, :asin, :acos, :acosh, :atanh, :acoth)
464464
sf = string(f)
465465
@eval function Base.$f(t::AbstractTensorMap)
466466
domain(t) == codomain(t) ||
467-
error("$($sf) of a tensor only exist when domain == codomain.")
467+
throw(SpaceMismatch("`$($sf)` of a tensor only exist when domain == codomain"))
468468
T = complex(float(scalartype(t)))
469469
tf = similar(t, T)
470470
for (c, b) in blocks(t)

0 commit comments

Comments
 (0)