Hello, I'm trying to solve the collatz conjecture in Julia but unfortunately it when I submit my code it tells me that I have two test failures. When testing x = 0 and x = -15 it should return a DomainError but my code returns an ErrorException. When I run the same code in VScode it does thro the DomainError. Does anyone know my mistake ? Thank you in advance.
function collatz_steps(x)
if x < 1
throw(error(DomainError))
end
steps = 0
while x > 1
if x % 2 == 0
x /= 2
else
x = 3x +1
end
steps +=1
end
return steps
end