~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

Detect and report MemoryError during a smart server request

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
        return ('TokenMismatch', err.given_token, err.lock_token)
447
447
    elif isinstance(err, errors.LockContention):
448
448
        return ('LockContention',)
 
449
    elif isinstance(err, MemoryError):
 
450
        # GZ 2011-02-24: Copy bzrlib.trace -Dmem_dump functionality here?
 
451
        return ('MemoryError',)
449
452
    # Unserialisable error.  Log it, and return a generic error
450
453
    trace.log_exception_quietly()
451
454
    return ('error', str(err))