Added artiq exception example

core0-buffer
pca006132 3 years ago
parent eb750eb1f0
commit 3d5515866f
  1. 20
      examples/exception.py

@ -0,0 +1,20 @@
from artiq.experiment import *
class ExceptionDemo(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("led0")
@kernel
def run(self):
self.core.reset()
print("OK!")
try:
try:
raise Exception
except ValueError as e:
print("re-raise")
raise e
except:
print("error")
Loading…
Cancel
Save