aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-08-01 16:32:37 +0000
committerrowanbeentje <rowan@beent.je>2010-08-01 16:32:37 +0000
commit99ac3b5a59e43296984fd794eefc500e0e314f54 (patch)
treea3cc8f94dd347a1f0bf363cf28eb245ada9285a4 /Source
parentaeb89462c557f2b9f79c070b7ce30fa68f63faf7 (diff)
downloadsequelpro-99ac3b5a59e43296984fd794eefc500e0e314f54.tar.gz
sequelpro-99ac3b5a59e43296984fd794eefc500e0e314f54.tar.bz2
sequelpro-99ac3b5a59e43296984fd794eefc500e0e314f54.zip
- Improve SPDataStorage exceptions by recording the requested location and the storage range
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDataStorage.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m
index 1b2de47e..200c4873 100644
--- a/Source/SPDataStorage.m
+++ b/Source/SPDataStorage.m
@@ -51,7 +51,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
// Construct the NSMutableArray
NSMutableArray *rowArray = [NSMutableArray arrayWithCapacity:numColumns];
@@ -71,7 +71,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the row or column index is out of bounds
- if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", rowIndex, columnIndex, numRows, numColumns];
// Return the content
return dataStorage[rowIndex][columnIndex];
@@ -158,7 +158,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index > numRows) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (index > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
// If "inserting" at the end of the array just add a row
if (index == numRows) return SPDataStorageAddRow(self, row);
@@ -198,7 +198,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
NSUInteger cellsProcessed = 0;
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
id *storageRow = dataStorage[index];
@@ -226,7 +226,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception of either index is out of bounds
- if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (rowIndex >= numRows || columnIndex >= numColumns) [NSException raise:NSRangeException format:@"Requested storage index (row %llu, col %llu) beyond bounds (%llu, %llu)", rowIndex, columnIndex, numRows, numColumns];
// Release the old object and retain the new one
if (dataStorage[rowIndex][columnIndex]) CFRelease(dataStorage[rowIndex][columnIndex]);
@@ -241,7 +241,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the index is out of bounds
- if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (index >= numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", index, numRows];
// Free the row
NSUInteger j = numColumns;
@@ -267,7 +267,7 @@ static inline void SPDataStorageEnsureCapacityForAdditionalRowCount(SPDataStorag
{
// Throw an exception if the range is out of bounds
- if (rangeToRemove.location + rangeToRemove.length > numRows) [NSException raise:NSRangeException format:@"Requested storage index beyond bounds"];
+ if (rangeToRemove.location + rangeToRemove.length > numRows) [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (rangeToRemove.location + rangeToRemove.length), numRows];
// Free rows in the range
NSUInteger i, j = numColumns;