concept error in category .net

This is an excerpt from Manning's book Concurrency in .NET.
To reduce complexity and errors in your program, you must raise the level of abstraction in the code. For example, to compute a sum of numeric values, express your intention in “what you want,” without repeating “how to do.” Common functionality should be part of the language, so you can express your intentions as
Figure 10.1 The user sends an update request, which can easily stray from the happy path. In general, you write code thinking that nothing can go wrong. But producing quality code must account for exceptions or possible issues such as validation, failure, or errors that prevent the code from running correctly.
![]()
Listing 10.1
DownloadImageAsyncwith traditional imperative error handlingstatic async Task<Image> DownloadImageAsync(string blobReference) { try { var container = await Helpers.GetCloudBlobContainerAsync(). ➥ ConfigureAwait(false); #1 CloudBlockBlob blockBlob = container.➥ GetBlockBlobReference(blobReference); #1 using (var memStream = new MemoryStream()) { await blockBlob.DownloadToStreamAsync(memStream).ConfigureAwait(false); #1 return Bitmap.FromStream(memStream); } } catch (StorageException ex) { Log.Error("Azure Storage error", ex); #2 throw; } catch (Exception ex) { Log.Error("Some general error", ex); #2 throw; } } async RunDownloadImageAsync() #3 { try { var image = await DownloadImageAsync("Bugghina0001.jpg"); ProcessImage(image); } catch (Exception ex) { HanldlingError(ex); #2 throw; } } #1 Observes operations that could raise an exception #3 Somewhere in the upper the call stack #2 Handles and re-throws the error to bubble up the exception to the call stack !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":12,\"ch\":5},{\"line\":12,\"ch\":10}],[{\"line\":17,\"ch\":5},{\"line\":17,\"ch\":10}],[{\"line\":31,\"ch\":5},{\"line\":31,\"ch\":10}],[{\"line\":12,\"ch\":12},{\"line\":12,\"ch\":28}],[{\"line\":15,\"ch\":8},{\"line\":15,\"ch\":13}],[{\"line\":20,\"ch\":8},{\"line\":20,\"ch\":13}],[{\"line\":34,\"ch\":1},{\"line\":34,\"ch\":6}],[{\"line\":40,\"ch\":19},{\"line\":40,\"ch\":24}],[{\"line\":12,\"ch\":5},{\"line\":12,\"ch\":10}],[{\"line\":17,\"ch\":5},{\"line\":17,\"ch\":10}],[{\"line\":31,\"ch\":5},{\"line\":31,\"ch\":10}],[{\"line\":12,\"ch\":19},{\"line\":12,\"ch\":28}],[{\"line\":17,\"ch\":12},{\"line\":17,\"ch\":21}],[{\"line\":31,\"ch\":12},{\"line\":31,\"ch\":21}],[{\"line\":15,\"ch\":8},{\"line\":15,\"ch\":13}],[{\"line\":20,\"ch\":8},{\"line\":20,\"ch\":13}],[{\"line\":34,\"ch\":1},{\"line\":34,\"ch\":6}],[{\"line\":40,\"ch\":19},{\"line\":40,\"ch\":24}],[{\"line\":12,\"ch\":5},{\"line\":12,\"ch\":10}],[{\"line\":17,\"ch\":5},{\"line\":17,\"ch\":10}],[{\"line\":31,\"ch\":5},{\"line\":31,\"ch\":10}],[{\"line\":12,\"ch\":19},{\"line\":12,\"ch\":28}],[{\"line\":17,\"ch\":12},{\"line\":17,\"ch\":21}],[{\"line\":31,\"ch\":12},{\"line\":31,\"ch\":21}],[{\"line\":15,\"ch\":8},{\"line\":15,\"ch\":13}],[{\"line\":20,\"ch\":8},{\"line\":20,\"ch\":13}],[{\"line\":34,\"ch\":1},{\"line\":34,\"ch\":6}],[{\"line\":40,\"ch\":19},{\"line\":40,\"ch\":24}]]"} !@%STYLE%@!

This is an excerpt from Manning's book DSLs in Boo: Domain-Specific Languages in .NET.
What are these warnings? You’re familiar with compiler warnings, which let you know that you’re doing something that you probably shouldn’t. Well, you can generate the same types of warnings at runtime, to actively detect and alert against behavior that’s likely to cause issues or errors at a later date.