from fusesoc.build.quartus import Quartus
from fusesoc.build.ise import Ise

def BackendFactory(system):
    if system.backend_name == 'quartus':
        return Quartus(system)
    elif system.backend_name == 'ise':
        return Ise(system)
    else:
        raise Exception("Backend not found")

from fusesoc.build.quartus import Quartus
from fusesoc.build.ise import Ise

def BackendFactory(system):
    if system.backend_name == 'quartus':
        return Quartus(system)
    elif system.backend_name == 'ise':
        return Ise(system)
    else:
        raise RuntimeError('Backend "{}" not found'.format(systaem.backend_name))

Improve error handling for unknown backends
Improve error handling for unknown backends

  from fusesoc.build.quartus import Quartus
  from fusesoc.build.ise import Ise
  
  def BackendFactory(system):
      if system.backend_name == 'quartus':
          return Quartus(system)
      elif system.backend_name == 'ise':
          return Ise(system)
      else:
-         raise Exception("Backend not found")
+         raise RuntimeError('Backend "{}" not found'.format(systaem.backend_name))
  
Improve error handling for unknown backends
## Code Before:
from fusesoc.build.quartus import Quartus
from fusesoc.build.ise import Ise

def BackendFactory(system):
    if system.backend_name == 'quartus':
        return Quartus(system)
    elif system.backend_name == 'ise':
        return Ise(system)
    else:
        raise Exception("Backend not found")

## Instruction:
Improve error handling for unknown backends
## Code After:
from fusesoc.build.quartus import Quartus
from fusesoc.build.ise import Ise

def BackendFactory(system):
    if system.backend_name == 'quartus':
        return Quartus(system)
    elif system.backend_name == 'ise':
        return Ise(system)
    else:
        raise RuntimeError('Backend "{}" not found'.format(systaem.backend_name))
