{"id":23156,"date":"2026-09-09T11:37:45","date_gmt":"2026-09-09T09:37:45","guid":{"rendered":"https:\/\/gpower.io\/avoid-letting-your-error-codes-become-the-new-blue-screen-of-death-24\/"},"modified":"2026-09-09T13:44:09","modified_gmt":"2026-09-09T11:44:09","slug":"avoid-letting-your-error-codes-become-the-new-blue-screen-of-death-24","status":"publish","type":"post","link":"https:\/\/gpower.io\/en\/avoid-letting-your-error-codes-become-the-new-blue-screen-of-death-24\/","title":{"rendered":"Don\u2019t let your error codes become the next Blue Screen of Death [3:4]"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"23156\" class=\"elementor elementor-23156 elementor-23138\" data-elementor-post-type=\"post\">\n\t\t\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-3089f21 e-flex e-con-boxed e-con e-parent\" data-id=\"3089f21\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e8371bc elementor-widget elementor-widget-heading\" data-id=\"e8371bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">This post [3:4] is part of a series by GPower systems engineer Jesper Kj\u00e6r S\u00f8rensen on building robust software and testing systems. <\/h2>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-b79cf37 e-flex e-con-boxed e-con e-parent\" data-id=\"b79cf37\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-49af1a1 elementor-widget elementor-widget-heading\" data-id=\"49af1a1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Does this sound familiar...?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-96451b0 elementor-widget elementor-widget-text-editor\" data-id=\"96451b0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>You have three hours left until your deadline, and then the one thing that must not happen happens. Your computer throws up a \u201cBlue Screen of Death\u201d and spontaneously restarts. After the restart, you discover that everything has been saved, and you\u2019ve had a lucky escape. You can still make your deadline, and all is well. But you\u2019re left with two questions: Why did the error occur, and how can I prevent it from happening again? In other words, you\u2019ve just encountered Windows\u2019 way of translating the computer\u2019s internal errors: the dreaded Blue Screen of Death!<br\/>I\u2019m well aware that Microsoft has painted it black in Windows 11, but that\u2019s not important for this article.      <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f944b61 elementor-widget elementor-widget-image\" data-id=\"f944b61\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/commons.wikimedia.org\/wiki\/File:Windows_11_BSOD,_build_22000.51.png\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-300x225.webp\" class=\"attachment-medium size-medium wp-image-23162\" alt=\"Don\u2019t let your error codes become the next Blue Screen of Death [3:4]\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-300x225.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-768x576.webp 768w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-600x450.webp 600w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1.webp 960w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Image 1: Windows 11 \u201cBlue\u201d Screen of Death<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5c77a91 elementor-widget elementor-widget-text-editor\" data-id=\"5c77a91\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In this third article in the series on error handling, we dive into the process of translating internal errors into external errors across an API boundary. The aforementioned\u2014and dreaded\u2014Blue Screen of Death is a prime example of how NOT to do it. Just to clarify: By translation, I don\u2019t mean linguistic translation from one language to another. I mean translating an internal error into a different, more specific error code. We\u2019ll also look at some systematic approaches that you can use to your advantage in your own code. The article is based on the graphical programming language LabVIEW, but the principles and practices involved in translating internal errors are equally relevant to other programming languages, such as Java, C#, and even Python. It\u2019s simply good programming practice.    <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6dafe52 elementor-widget elementor-widget-heading\" data-id=\"6dafe52\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Why should you translate your error codes?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f37ea33 elementor-widget elementor-widget-text-editor\" data-id=\"f37ea33\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Translating error codes serves several purposes. It should be seen more as an active process of filtering what is relevant to report further. <\/p><p>If you don\u2019t translate your errors into API-specific errors, it becomes more difficult to determine where a generic error code originates. After all, it could just as easily come from the code calling the API as from your product API itself. <\/p><p>Returning a specific error code that matches the API action the user attempted provides more meaningful information. For example, if your API communicates with a web service to create a user, it makes little sense to report the status code returned by the web service when an error occurs. The action your user is trying to perform is to create a user, so the error should be translated into a specific error related to user creation. That error can then include parameters that make troubleshooting easier for the user, such as characters that are not allowed or similar information.   <\/p><p>Translating error codes improves the consistency of your API by ensuring that the functions provided by your API return logical and meaningful responses. This is important when your API executes successfully, but it is just as important when your API fails. After all, you don\u2019t want your API to become the new \u201cBlue Screen of Death\u201d in your product category.  <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0eee44d elementor-widget elementor-widget-heading\" data-id=\"0eee44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">The benefits of error code translation<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7f3c509 elementor-widget elementor-widget-text-editor\" data-id=\"7f3c509\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Error codes are part of your API\u2019s interface, and they help determine the backward compatibility of your API. This is yet another reason to translate your error codes into more specific codes. What happens, for example, if the previously mentioned web service changes the status code it returns when a user cannot be created? If you translate the web service\u2019s error code, you can still translate the new status code into the same API-specific error code. In the other scenario, however, you have broken backward compatibility. Your error handling\u2014or more specifically, its implementation\u2014breaks when a different error code suddenly comes out of your API. Translating error codes therefore helps decouple your API from the service or measurement instrument it was built to work with. This gives you the freedom to change the underlying implementation without breaking backward compatibility. And if you need techniques for filtering error codes, I recommend taking a look at <a href=\"https:\/\/gpower.io\/en\/error-handling-in-labview-24\/\">my previous article on error handling<\/a>.       <\/p><p>You should only translate errors in the functions exposed through the API interface. Error code translation always involves finding the right level of granularity for your error codes. It may be tempting to translate all your internal errors into a single error, but this removes their communicative value, much like the aforementioned Blue Screen of Death. On the other hand, if each individual internal error is split into several different error codes, it will become increasingly difficult over time to keep track of which errors are used by each function. As a developer, you therefore need to decide which errors can be reported by each individual function exposed through the API interface. In other words, you need to take a systematic approach.     <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9f6779f elementor-widget elementor-widget-heading\" data-id=\"9f6779f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">GPower\u2019s error code system<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b0fa990 elementor-widget elementor-widget-text-editor\" data-id=\"b0fa990\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In LabVIEW, there is no class-based error code system like there is in, for example, Python, where you can inherit from a general error class. This is because <a href=\"https:\/\/labviewwiki.org\/wiki\/Error_Cluster_data_type\" target=\"_blank\" rel=\"noopener\">LabVIEW Error Clusters<\/a> existed before LabVIEW included support for object-oriented programming. Therefore, a convention has been established that all user-specific errors reside in one of the three ranges shown in Figure 2.  <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-766d321 elementor-widget elementor-widget-image\" data-id=\"766d321\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/NI-Range-af-fejlkoder.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"NI Range af fejlkoder\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMyMzAsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9OSS1SYW5nZS1hZi1mZWpsa29kZXIud2VicCJ9\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1629\" height=\"273\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/NI-Range-af-fejlkoder.webp\" class=\"attachment-full size-full wp-image-23230\" alt=\"\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 2: LabVIEW error code ranges for user-defined errors<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-802c125 elementor-widget elementor-widget-text-editor\" data-id=\"802c125\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>There are many possible ways to structure your error codes. No single error description or code can adequately cover all the errors that may occur within your API. It is therefore important to group errors logically to create a clear and meaningful structure. At GPower, we have established our own set of rules for how developers create API-specific error codes: Only error codes between 5000 and 9999 are used:    <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b9aefba elementor-align-start elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"b9aefba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">The four digits of the error code are divided into grouping and sequential numbering<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">The first two digits represent the error group (50, \u2026, 99)<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">The last two digits are a sequential counter (00, 01, \u2026, 99)<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">All error codes are placed in a specific folder in each API<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">An error code mapping is implemented in its own VI<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">An error code VI has a matching icon so they are recognisable<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">An error code must support multiple languages<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Error codes must support being called with different priorities without side effects<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Error code VIs are private to the API, but must be reusable internally where it makes sense<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-81f3241 elementor-widget elementor-widget-text-editor\" data-id=\"81f3241\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In other words, we have put a lot of thought into error code translation, and perhaps some or even all of these considerations could be useful to you as well?<\/p><p>By encapsulating the translation in a VI, you gain the advantage of being able to use all of LabVIEW\u2019s search tools to find where a specific error code is used. Error code translations can also be reused if they are functionally relevant to another API function. There is no reason to create another error code for exactly the same purpose within the same API.  <\/p><p>A very important point is that a VI for error code translation should be private to the API that implements it. This prevents the same function from being reused across the interface between two APIs. When you think about it, doing so would create an undesirable dependency. It is better to create a VI with the same content and document it in the other API. That way, if the first API later removes the error code, the second API will continue to work. Similarly, developers should not synchronize the sequential error code numbers across APIs. Two error codes can have the same number in two different APIs, as long as they exist in separate libraries.      <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5d098c0 elementor-widget elementor-widget-heading\" data-id=\"5d098c0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">GPower Custom Error Assistant to support developers<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e86141c elementor-widget elementor-widget-text-editor\" data-id=\"e86141c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Keeping track of all these elements while developing code can be overwhelming. That is why, at GPower, we have automated the process of creating VIs for error code translation, leaving only the translation itself to be customized. This is done using our internal tool, the GPower Custom Error Assistant. <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4b022b1 elementor-widget elementor-widget-image\" data-id=\"4b022b1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/GPower-Custom-Error-Assistant.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"GPower Custom Error Assistant\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMyMjgsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9HUG93ZXItQ3VzdG9tLUVycm9yLUFzc2lzdGFudC53ZWJwIn0%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"540\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/GPower-Custom-Error-Assistant.webp\" class=\"attachment-full size-full wp-image-23228\" alt=\"\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 3: GPower Custom Error Assistant<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9e0806f elementor-widget elementor-widget-text-editor\" data-id=\"9e0806f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>The assistant is designed to ensure consistent solutions across internal APIs and customer projects. It automatically selects the next sequential number in the series of error codes within the chosen category and ensures that the error code is stored in the correct location. In addition, the assistant helps you see which errors belong to the selected category. When creating an error code, you simply choose the category you want to use and give the error code a name.   <\/p><p>The result of creating error code 5500 can be seen in Figure 4 below. Note in particular that the number of the individual error translation is also displayed in the icon of this VI. If the error code requires specific parameters for troubleshooting, it is easier to modify the arguments that have already been created, or simply delete them if they are not needed. I should also briefly mention that the template includes built-in support for translating error messages into different languages.   <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5a4510f elementor-widget elementor-widget-image\" data-id=\"5a4510f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/GPower-Custom-Error-Blockdiagram.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"GPower Custom Error Blockdiagram\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMyMjksInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9HUG93ZXItQ3VzdG9tLUVycm9yLUJsb2NrZGlhZ3JhbS53ZWJwIn0%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"457\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/GPower-Custom-Error-Blockdiagram.webp\" class=\"attachment-full size-full wp-image-23229\" alt=\"\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 4: Template VI for error mapping with arguments<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-39ed78b elementor-widget elementor-widget-text-editor\" data-id=\"39ed78b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>If we look at an example from our Application v2 package, which includes the \u201cGet VI Name\u201d function, it is easy to see how the error code is implemented, as shown in Figure 5.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2eb26a9 elementor-widget elementor-widget-image\" data-id=\"2eb26a9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"Custom error in use\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMyMjcsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9DdXN0b20tZXJyb3ItaW4tdXNlLnBuZyJ9\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"297\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use.png\" class=\"attachment-full size-full wp-image-23227\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use.png 857w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use-300x104.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use-768x266.png 768w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Custom-error-in-use-600x208.png 600w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 5: Error code mapping in practice <\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35e47e3 elementor-widget elementor-widget-text-editor\" data-id=\"35e47e3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Any errors that occur within the function are translated into error 5501 \u2013 \u201cVI Property Error\u201d, with a parameter specifying the VI\u2019s location on disk. In other words, no other error codes can be returned by this function. <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7512fd0 elementor-widget elementor-widget-heading\" data-id=\"7512fd0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">A final comment<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6f40f5f elementor-widget elementor-widget-text-editor\" data-id=\"6f40f5f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>With this article, you should now be well equipped to create your own translations from internal errors to specific error codes. I am well aware that you do not have access to either our GPower Custom Error Assistant or the Application API, but these should be seen as examples of how it CAN be done. Not all of our rules will necessarily be right for you, so choose the ones that work and make use of them. The most important thing is to be consistent in your approach.   <\/p><p>Before wrapping up, I would like to address one question you may still have. You might be wondering why there is only room for 100 error codes in each category. But if you need 100 unique error codes without any reuse within your API, there are probably other issues you should address, such as the modularization of your code.  <\/p><p>Feel free to use the comments on LinkedIn if you have any feedback or questions about the article.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-0e276ac e-flex e-con-boxed e-con e-parent\" data-id=\"0e276ac\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-5f8a95e e-con-full e-flex e-con e-child\" data-id=\"5f8a95e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7875b98 elementor-widget elementor-widget-image\" data-id=\"7875b98\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"286\" height=\"222\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2025\/09\/Quote.png\" class=\"attachment-full size-full wp-image-21498\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-929671c elementor-widget elementor-widget-text-editor\" data-id=\"929671c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p><em>You should ONLY translate errors in functions exposed through the API interface.<\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-60d5745 elementor-widget elementor-widget-text-editor\" data-id=\"60d5745\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>\u2013 LabVIEW Champion, Jesper Kj\u00e6r S\u00f8rensen, GPower<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3233d10 elementor-shape-circle elementor-grid-0 e-grid-align-center elementor-widget elementor-widget-social-icons\" data-id=\"3233d10\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"social-icons.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-social-icons-wrapper elementor-grid\">\n\t\t\t\t\t\t\t<span class=\"elementor-grid-item\">\n\t\t\t\t\t<a class=\"elementor-icon elementor-social-icon elementor-social-icon-linkedin elementor-repeater-item-ccb2421\" href=\"https:\/\/www.linkedin.com\/pulse\/manglende-fejlh%C3%A5ndtering-den-usynlige-tidsr%C3%B8ver-s%C3%B8rensen-nntrf\/\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t<span class=\"elementor-screen-only\">Linkedin<\/span>\n\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-linkedin\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z\"><\/path><\/svg>\t\t\t\t\t<\/a>\n\t\t\t\t<\/span>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>This post [3:4] is part of a series by GPower systems engineer Jesper Kj\u00e6r S\u00f8rensen on building robust software and testing systems. Does this sound familiar&#8230;? You have three hours left until your deadline, and then the one thing that must not happen happens. Your computer throws up a \u201cBlue Screen of Death\u201d and spontaneously [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":23162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[82],"tags":[109],"class_list":["post-23156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-insights"],"_links":{"self":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/comments?post=23156"}],"version-history":[{"count":10,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23156\/revisions"}],"predecessor-version":[{"id":23238,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23156\/revisions\/23238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/media\/23162"}],"wp:attachment":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/media?parent=23156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/categories?post=23156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/tags?post=23156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}