readFile { try { open the file; determine its size; allocate that much memory; read the file into memory; close the file; } catch ( fileOpenFailed ) { doSomething; } catch ( sizeDeterminationFailed ) { doSomething; } catch ( memoryAllocationFailed ) { doSomething; } catch ( readFailed ) { doSomething; } catch ( fileCloseFailed ) { doSomething; } }