Deploying upstream@0835c6d8ae075228e93cbe4beb3cf722b5fff884: Fix Now link to point to starfort
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
content="2026-01-10">
|
||||
<meta
|
||||
property="og:article:modified_time"
|
||||
content="2026-01-10">
|
||||
content="2026-05-21">
|
||||
<meta
|
||||
property="og:article:author"
|
||||
content="Andrew Kesterson">
|
||||
@@ -304,12 +304,12 @@
|
||||
alt="author avatar">
|
||||
|
||||
<p class="author-name">Andrew Kesterson</p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://github.com/akesterson">GitHub</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<p class="author-description"><center><i>"Love God. Live Righteously. Die Well."</i> <br/> <br/> <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew">Source Code</a> || <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/andrewkesterson/">LinkedIn</a> <br/> </center></p>
|
||||
<div class="author-message">
|
||||
<a
|
||||
class="author-posts-count"
|
||||
href="/archives">
|
||||
<span>28</span>
|
||||
<span>29</span>
|
||||
<span>Posts</span>
|
||||
</a>
|
||||
<a
|
||||
@@ -405,7 +405,7 @@
|
||||
<a href="/categories/Technology/">
|
||||
<div class="categories-list-item">
|
||||
Technology
|
||||
<span class="categories-list-item-badge">10</span>
|
||||
<span class="categories-list-item-badge">11</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -474,9 +474,9 @@
|
||||
id="section"
|
||||
class="post-content">
|
||||
<p>I’d like to present a C library I wrote for exception style error handling in C code, why I wrote it, and why I prefer this style of error handling when writing in the C language. </p>
|
||||
<p><a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror">libakerror: A safe exception handling library for C</a></p>
|
||||
<p><a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror">libakerror: A safe exception handling library for C</a></p>
|
||||
<p>To be clear, when I say “exception style error handling”, I am referring to the practice of one section of code creating an <code>exception</code> object, which is an object containing a rich error context, and then the language <code>raising</code> (or <code>throwing</code>) that exception up through the call stack, allowing all code paths in the call stack the opportunity to respond to that exception, and if the exception reaches all the way back up to the program’s top level without being handled, it will terminate the program.</p>
|
||||
<p>Before completing this article, I strongly recommend that you go and read <a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror/blob/main/README.md">the libakerror README</a>, at least the “Library Architecture” section. This article will not spend a lot of time explaining <strong>what</strong> libakerror does, or even <strong>how</strong> it does it, but rather <strong>why</strong> I prefer this style of error handling. So if you don’t go through the README, you may be a bit lost for the rest of the article.</p>
|
||||
<p>Before completing this article, I strongly recommend that you go and read <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror/blob/main/README.md">the libakerror README</a>, at least the “Library Architecture” section. This article will not spend a lot of time explaining <strong>what</strong> libakerror does, or even <strong>how</strong> it does it, but rather <strong>why</strong> I prefer this style of error handling. So if you don’t go through the README, you may be a bit lost for the rest of the article.</p>
|
||||
<center><img alt="Ill wait" src="/images/waiting-bear.webp"/></center>
|
||||
|
||||
<p>Note that the question of “why do you like writing software in C so much” won’t be answered here. That’s a separate blog post TBD. This post also assumes you are already familiar with the C programming language, although if you know any programming languages at all, you can probably get through it. If you don’t know C, I strongly recommend these two books:</p>
|
||||
@@ -771,7 +771,7 @@ ATTEMPT <span class="token punctuation">{</span>
|
||||
<p>Without good debug logs, a program is much more difficult to debug.</p>
|
||||
</blockquote>
|
||||
<p>I’ve spent the majority of my career working with software that runs in environments where the only hope for debugging it is to interrogate some log files after an error has already occurred. Getting the chance to attach a debugger and examine the state of the running program is a rare treat that we almost never get to experience in the DevSecOps world. So if a program does not emit useful logs, in my opinion, it is basically impossible to debug it in my world.</p>
|
||||
<p>And even when you have a debugger, a log is still a good way to quickly hone in on <em>where</em> something happened, even if you must take a much longer time to figure out <em>why</em> it happened. Let’s consider the code in <a target="_blank" rel="noopener" href="https://github.com/akesterson/libakerror/blob/main/tests/err_trace.c">one of the libakerror test programs</a>.</p>
|
||||
<p>And even when you have a debugger, a log is still a good way to quickly hone in on <em>where</em> something happened, even if you must take a much longer time to figure out <em>why</em> it happened. Let’s consider the code in <a target="_blank" rel="noopener" href="https://source.starfort.tech/andrew/libakerror/blob/main/tests/err_trace.c">one of the libakerror test programs</a>.</p>
|
||||
<p>In this code, we have a call graph like <code>main() -> func1() -> func2()</code>. In <code>func2()</code> we experience some error that causes us to exit early. If we were to run this in naked C, it might look like this:</p>
|
||||
<pre class="line-numbers language-c" data-language="c"><code class="language-c"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string"><stdio.h></span></span>
|
||||
|
||||
@@ -1222,6 +1222,11 @@ _writeToFile_cleanup<span class="token operator">:</span>
|
||||
</div>
|
||||
<div class="recent-posts-list">
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-05-15</div>
|
||||
<a href="/2026/05/15/Devlog-20260518/"><div class="recent-posts-item-content">Devlog Entry</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-02-23</div>
|
||||
<a href="/2026/02/23/Why-Firefighting/"><div class="recent-posts-item-content">Why Firefighting</div></a>
|
||||
@@ -1237,11 +1242,6 @@ _writeToFile_cleanup<span class="token operator">:</span>
|
||||
<a href="/2026/01/30/News-2026-Week-4/"><div class="recent-posts-item-content">News - 2026 - Week 4</div></a>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts-item">
|
||||
<div class="recent-posts-item-title">2026-01-25</div>
|
||||
<a href="/2026/01/25/Two-kinds-of-programmers/"><div class="recent-posts-item-content">There are two kinds of programmers</div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user