[NCBC-165] GetView doesn't return an exception if the view doesn't exist. Created: 26/Nov/12 Updated: 05/Feb/13 Resolved: 05/Feb/13 |
|
| Status: | Closed |
| Project: | Couchbase .NET client library |
| Component/s: | library |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kyle Sama | Assignee: | John Zablocki |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Visual Studio 2012, .net Client, couchbase 2.0,
win7/x64 |
||
| Description |
|
When you call var result = _couchClient.GetView(<etc.>), there is no exception thrown when the view does not exist. The program will only throw an exception when it attempts to access the data, ie: result.Count() will throw an exception.
|
| Comments |
| Comment by John Zablocki [ 26/Dec/12 ] |
|
The view isn't queried until the IEnumerable is actually iterated over. Therefore when you call GetView, there's no way to know that the view doesn't exist.
I will look into catching the 400 error and throwing a more meaningful exception. |
| Comment by John Zablocki [ 18/Jan/13 ] |
| Baking better exceptions into the view reading process and providing a CheckExists method. |
| Comment by John Zablocki [ 05/Feb/13 ] |
| Released |