summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--different_ways_of_reporting_errors-1.png (renamed from different_ways_of_making_errors-1.png)bin1544 -> 1544 bytes
-rw-r--r--different_ways_of_reporting_errors-2.png (renamed from different_ways_of_making_errors-2.png)bin1305 -> 1305 bytes
-rw-r--r--different_ways_of_reporting_errors-3.png (renamed from different_ways_of_making_errors-3.png)bin1899 -> 1899 bytes
-rw-r--r--different_ways_of_reporting_errors-4.png (renamed from different_ways_of_making_errors-4.png)bin1593 -> 1593 bytes
-rw-r--r--different_ways_of_reporting_errors.html (renamed from different_ways_of_making_errors.html)14
-rw-r--r--index.html13
6 files changed, 10 insertions, 17 deletions
diff --git a/different_ways_of_making_errors-1.png b/different_ways_of_reporting_errors-1.png
index 6278a1c..6278a1c 100644
--- a/different_ways_of_making_errors-1.png
+++ b/different_ways_of_reporting_errors-1.png
Binary files differ
diff --git a/different_ways_of_making_errors-2.png b/different_ways_of_reporting_errors-2.png
index 4fd0bb1..4fd0bb1 100644
--- a/different_ways_of_making_errors-2.png
+++ b/different_ways_of_reporting_errors-2.png
Binary files differ
diff --git a/different_ways_of_making_errors-3.png b/different_ways_of_reporting_errors-3.png
index ee5d201..ee5d201 100644
--- a/different_ways_of_making_errors-3.png
+++ b/different_ways_of_reporting_errors-3.png
Binary files differ
diff --git a/different_ways_of_making_errors-4.png b/different_ways_of_reporting_errors-4.png
index 28c27fb..28c27fb 100644
--- a/different_ways_of_making_errors-4.png
+++ b/different_ways_of_reporting_errors-4.png
Binary files differ
diff --git a/different_ways_of_making_errors.html b/different_ways_of_reporting_errors.html
index e62168e..4e8d07c 100644
--- a/different_ways_of_making_errors.html
+++ b/different_ways_of_reporting_errors.html
@@ -7,13 +7,13 @@
<link rel="icon" type="image/png" href="cylo.png">
<link rel="stylesheet" href="style.css">
-<title>Different Ways of Making Errors</title>
+<title>Different Ways of Reporting Errors</title>
<nav><p><a href="https://ignore.pl">ignore.pl</a></p></nav>
<article>
-<h1>Different Ways of Making Errors</h1>
-<p class="subtitle">Published on 2022-04-28 19:00:00+02:00, last modified on 2022-04-29 10:37:00+02:00
+<h1>Different Ways of Reporting Errors</h1>
+<p class="subtitle">Published on 2022-04-28 19:00:00+02:00, last modified on 2022-06-17 22:27:00+02:00
<p>Errors are a key component of writing software - programs, libraries, scripts, you name it. We need to check for
them, catch them, mitigate, log, and finally create. In this article, I want to give you an overview of various methods
of that last activity - creating errors - sometimes also called raising or throwing, especially when the errors are
@@ -26,7 +26,7 @@ paragraph.
<p>Now then, as I was writing this article the classification of these methods evolved quite a few times. I doubt this
is the final form and depending on the feedback and my future endeavours I hope that I'll continue to make this list
better.</p>
-<img src="different_ways_of_making_errors-1.png" alt="red flags">
+<img src="different_ways_of_reporting_errors-1.png" alt="red flags">
<h2>Returning the Error</h2>
@@ -116,7 +116,7 @@ forced to return a single primitive object from the function?
with them. Sometimes selecting those values can be straight-forward - for instance when the domain already has an
invalid space. Consider sizes which are usually represented with zero and positive integers, meaning if you use signed
integer as return value then you will have all of the negative numbers available to represent errors.</p>
-<img src="different_ways_of_making_errors-2.png" alt="ruler with negative length">
+<img src="different_ways_of_reporting_errors-2.png" alt="ruler with negative length">
<p>This is the approach used by <strong>read</strong>(3). When successful the function returns amount of bytes read,
but on error it returns <code>-1</code> and sets a special global <b>errno</b>(3) to a value that describes what
exact error occurred:
@@ -211,7 +211,7 @@ new_message() {
return msg;
}
</pre>
-<img src="different_ways_of_making_errors-3.png" alt="killing will commence">
+<img src="different_ways_of_reporting_errors-3.png" alt="killing will commence">
<p>Without going deep into a discussion about whether early returns are good or bad (and I recall a few heated
discussions about it), you can already see that there is one already mentioned major flaw in it - it operates just on a
single level: in functions. Now, one way to overcome this limitation is going full nuclear.
@@ -365,7 +365,7 @@ other signal.
<h2>Final Notes</h2>
-<img src="different_ways_of_making_errors-4.png" alt="escape route">
+<img src="different_ways_of_reporting_errors-4.png" alt="escape route">
<p>Anything else? Probably yes. I tried to note similarities between the methods and mention some derivatives, but the
chance that I did not miss anything are rather thin. I think that there are some basic characteristics to be observed
among all (or some) of them.
diff --git a/index.html b/index.html
index 8e7ed16..6c57566 100644
--- a/index.html
+++ b/index.html
@@ -35,7 +35,9 @@
<section id="blog">
<h2>Blog</h2>
<ul>
-<li> <a href="different_ways_of_making_errors.html">Different Ways of Making Errors</a><br>
+<li> Renamed <i>Different Ways of Making Errors</i> to <i>Reporting</i><br>
+ <time>2022-06-17</time>
+<li> <a href="different_ways_of_reporting_errors.html">Different Ways of Reporting Errors</a><br>
<time>2022-04-28</time>
<li> <a href="starshatter_open_dev_update_2022_04.html">Starshatter: The Open Source Project - Dev Update -
April 2022</a><br>
@@ -47,17 +49,10 @@
<li> <a href="starshatter_open_dev_update_2022_01.html">Starshatter: The Open Source Project - Dev Update -
January 2022</a><br>
<time>2022-01-30</time>
-<li> Renovated <i>Markdown Is Bad for You</i><br>
- <time>2022-01-30</time>
<li> <a href="git_rebase_illustrated_with_time_travel.html">Git Rebase Illustrated With Time Travel</a><br>
<time>2022-01-28</time>
<li> <a href="you_can_serve_static_data_over_http.html">You Can Serve Static Data Over HTTP</a><br>
<time>2022-01-27</time>
-<li> Renamed article from yesterday and fixed some typos around the place.<br>
- Updated POSIX tar, cpio and pax guide with better headers.<br>
- I'm once again on an experimenting rampage with how this website looks, is indexed and whatever crosses my path.
- I removed and merged a few entries in this blog's index and I added descriptions for projects in main index.<br>
- <time>2022-01-26</time>
<li> <a href="how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory.html">How to Create
Generic Interfaces by Example of Storing Files in Arbitrary Memory</a><br>
<time>2022-01-25</time>
@@ -71,8 +66,6 @@
<time>2021-04-07</time>
<li> <a href="how_to_organize_your_lua_project.html">How To Organize Your Lua Project</a><br>
<time>2021-01-07</time>
-<li> News and updates are part of the blog index from now on.<br>
- <time>2021-01-01</time>
<li> <a href="dear_imgui_and_love.html">Dear ImGui and LÖVE,</a><br>
<time>2020-08-14</time>
<li> <a href="how_to_write_a_minimal_html5_document.html">How to Write a Minimal HTML5 Document</a><br>