Ignore:
Timestamp:
Dec 28, 2009, 2:03:33 PM (15 years ago)
Author:
broder
Message:

Add more user-friendly error handling for common errors, so they don't
send us e-mail. (LP: #307296)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/controls.py

    r2737 r2803  
    7474        raise InvalidInput('action', 'create',
    7575                           'VM %s is already on' % machine.name)
     76    elif 'I need' in err and 'but dom0_min_mem is' in err:
     77        raise InvalidInput('action', 'create',
     78                           "We're really sorry, but our servers don't have enough capacity to create your VM right now. Try creating a VM with less RAM, or shutting down another VM of yours. Feel free to ask %s if you would like to know when we plan to have more resources." % (config.contact))
     79    elif ('Booting VMs is temporarily disabled for maintenance, sorry' in err or
     80          'LVM operations are temporarily disabled for maintenance, sorry' in err):
     81        raise InvalidInput('action', 'create',
     82                           err)
     83    elif "Boot loader didn't return any data!" in err:
     84        raise InvalidInput('action', 'create',
     85                           "The ParaVM bootloader was unable to find an operating system to boot. Do you have GRUB configured correctly?")
     86    elif 'xc_dom_find_loader: no loader found' in err:
     87        raise InvalidInput('action', 'create',
     88                           "The ParaVM bootloader was unable to boot the kernel you have configured. Are you sure this kernel is capable of running as a Xen ParaVM guest?")
    7689    elif err:
    7790        raise CodeError('"%s" on "control %s create %s'
Note: See TracChangeset for help on using the changeset viewer.