{"id":23156,"date":"2026-09-07T14:37:45","date_gmt":"2026-09-07T12:37:45","guid":{"rendered":"https:\/\/gpower.io\/avoid-letting-your-error-codes-become-the-new-blue-screen-of-death-24\/"},"modified":"2026-09-07T15:28:51","modified_gmt":"2026-09-07T13:28:51","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":"Avoid letting your error codes become the new 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 GPowers software developer, Jesper Kj\u00e6r S\u00f8rensen, on building robust software and test 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\">Do you know the feeling...?<\/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>There are three hours until the deadline for your assignment, and then it happens\u2014the one thing that must not happen. Your computer shows a \u201cBlue Screen of Death\u201d and restarts spontaneously. After the restart, you can see that everything has been saved, and you got away with a scare. You can still meet your deadline, and everything is fine. But you are left with the questions: why did the error occur, and how do I avoid it happening again? In other words, you have encountered Windows\u2019 way of translating the computer\u2019s internal errors: the dreaded Blue Screen of Death! I am well aware that Microsoft has painted it black in Windows 11, but that is 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=\"150\" height=\"150\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-150x150.webp\" class=\"attachment-thumbnail size-thumbnail wp-image-23162\" alt=\"Avoid letting your error codes become the new Blue Screen of Death [3:4]\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-150x150.webp 150w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-300x300.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-1-Windows-11-Blue-Screen-of-Death-1-100x100.webp 100w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>\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 take a closer look at the process of translating internal errors into external errors across the API interface\u2014where the infamous Blue Screen of Death is an example of how NOT to do it. To be clear: by \u201ctranslation\u201d I do not mean linguistic translation into another language, but translation into a different and more specific error code. We also look at some of the approaches you can use to good effect in your code. The article is based on the graphical programming language LabVIEW, but the practice of translating internal errors is also relevant for other programming languages such as Java, C#, and even Python. It is 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 is about several things. It should rather be seen as an active filtering of what is relevant to report onward. <\/p><p>If you do not translate your errors into API-specific errors, it becomes harder to troubleshoot where a generic error code originates. It could just as well come from the API-calling code as from your product API. <\/p><p>It increases the communication value to return a specific code that matches the API action the user attempted. If your API, for example, communicates with a web service to create a user there, it does not make sense to report the status code that the web service returns on error. The action your user is trying to complete is to create a user, so it should be translated into a specific \u201cuser creation\u201d error. That error can then include parameters that make it easier for your user to troubleshoot, such as disallowed characters or similar.   <\/p><p>Translating the error codes increases the coherence of your API, because the functions your API provides return a logical response. This response is important when your API executes successfully, but absolutely also when your API fails. Ideally, your API should not become the new \u201cBlue Screen of Death\u201d within 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 mapping<\/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 interface, and they help determine your API\u2019s backward compatibility. This is another reason to translate your error codes into a more specific code. If the aforementioned web service changes its status code to a different one when a user cannot be created, what happens then? If you translate the web service\u2019s error code, you can still translate to the same error code\u2014whereas the other scenario results in breaking backward compatibility. In other words, this specific implementation fails when a different error code comes out of your API. Thus, translating error codes helps decouple your API from the service or measuring instrument it is built for. This gives you the freedom to change the underlying implementation without breaking backward compatibility. If you also need techniques for sorting error codes, you may want to take 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 on the functions in the API interface. Translating error codes is always a trade-off in how granular your error codes should be. It can be tempting to translate all your internal errors into a single error, but that removes the communication value\u2014just like the aforementioned Blue Screen of Death. Conversely, if each internal error is split into several different error codes, it becomes a problem over time to keep track of which errors are used in each function. Therefore, as a developer you must decide which errors can be reported back from each individual function that exists in the API interface. In other words, it is necessary 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 LabVIEW 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\/Figur-2-LabVIEW-Fejlkodeomraader-for-brugerdefinerede-fejl.webp\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"Figure 2 LabVIEW error code ranges for user-defined errors.\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMxNTgsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9GaWd1ci0yLUxhYlZJRVctRmVqbGtvZGVvbXJhYWRlci1mb3ItYnJ1Z2VyZGVmaW5lcmVkZS1mZWpsLndlYnAifQ%3D%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"104\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-2-LabVIEW-Fejlkodeomraader-for-brugerdefinerede-fejl.webp\" class=\"attachment-large size-large wp-image-23158\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-2-LabVIEW-Fejlkodeomraader-for-brugerdefinerede-fejl.webp 624w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-2-LabVIEW-Fejlkodeomraader-for-brugerdefinerede-fejl-300x50.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-2-LabVIEW-Fejlkodeomraader-for-brugerdefinerede-fejl-600x100.png 600w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/>\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>Creating your own error codes provides many possible combinations. There is no error description or code that adequately covers all the errors that may occur within your API. Therefore, it is important to group the errors in a logical way so that the error handling has a sensible structure. At GPower, we have created our own rule set for how developers at GPower 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, there are many considerations we have made around error code mapping for ourselves\u2014and perhaps all or some of them may be useful to you?<\/p><p>By encapsulating the mapping in a VI, you gain the advantage that you can use all of LabVIEW\u2019s search tools to find where the given error code is used. The error code mapping can also be reused if it functionally fits into another API function. There is no reason to create yet another error code for exactly the same function in the same API.  <\/p><p>A very important point is that a VI for error code mapping is private to the API that implements it. This removes the possibility of reusing the same function across the interface between two APIs. When you think about it, that would create a strange dependency. It is better to create the VI with the same content and document it in the other API. If the first API then removes the error code, the other API will still work. Similarly, the developer should not synchronise the sequential number for the error code across APIs. Two error codes with the same number can exist in different APIs, as long as they exist in their respective 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 help the developer<\/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>It can be overwhelming to keep track of all these elements when developing code, and therefore at GPower we have automated the creation of VIs for mapping the error codes, so that only the adjustment of the mapping remains. This is done via our internal tool, 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\/Figur-3-GPower-Custom-Error-Assistant.webp\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"Figure 3 GPower Custom Error Assistant\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMxNTksInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9GaWd1ci0zLUdQb3dlci1DdXN0b20tRXJyb3ItQXNzaXN0YW50LndlYnAifQ%3D%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"405\" height=\"316\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-3-GPower-Custom-Error-Assistant.webp\" class=\"attachment-large size-large wp-image-23159\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-3-GPower-Custom-Error-Assistant.webp 405w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-3-GPower-Custom-Error-Assistant-300x234.webp 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/>\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 built to ensure consistent solutions across internal APIs as well as customer projects. It automatically selects the next sequential number in the series of error codes within the category, and it also ensures that the error code is saved in the correct location. In addition, the assistant helps show which errors belong under the selected category. During creation, you decide which error code category you want to create and name the error code.   <\/p><p>The result of an error 5500 can be seen in Figure 4 below. Note in particular that the number for the individual error mapping is also shown in the icon for this VI. If the error code requires specific parameters for troubleshooting, it is easier to modify the arguments that have already been created\u2014or delete them. In addition, I can briefly mention that the template also includes built-in support for linguistic translation of error codes.   <\/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\/Figur-4-Template-VI-til-fejloversaettelse-med-argumenter.webp\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"Figure 4 Template VI for error mapping with arguments\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMxNjAsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9GaWd1ci00LVRlbXBsYXRlLVZJLXRpbC1mZWpsb3ZlcnNhZXR0ZWxzZS1tZWQtYXJndW1lbnRlci53ZWJwIn0%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"439\" height=\"319\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-4-Template-VI-til-fejloversaettelse-med-argumenter.webp\" class=\"attachment-large size-large wp-image-23160\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-4-Template-VI-til-fejloversaettelse-med-argumenter.webp 439w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-4-Template-VI-til-fejloversaettelse-med-argumenter-300x218.webp 300w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/>\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, where we have the function \u201c\u201d, it is easy to see how the error code is implemented\u2014see 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\/Figur-5-Oversaettelse-af-fejlkoder-i-praksis.webp\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"Figure 5 Error code mapping in practice\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjMxNjEsInVybCI6Imh0dHBzOlwvXC9ncG93ZXIuaW9cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjZcLzA5XC9GaWd1ci01LU92ZXJzYWV0dGVsc2UtYWYtZmVqbGtvZGVyLWktcHJha3Npcy53ZWJwIn0%3D\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"216\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-5-Oversaettelse-af-fejlkoder-i-praksis.webp\" class=\"attachment-large size-large wp-image-23161\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-5-Oversaettelse-af-fejlkoder-i-praksis.webp 624w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-5-Oversaettelse-af-fejlkoder-i-praksis-300x104.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/09\/Figur-5-Oversaettelse-af-fejlkoder-i-praksis-600x208.webp 600w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/>\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 inside the function are all mapped to error 5501 \u2013 \u201cVI Property Error\u201d with a parameter for the VI\u2019s location on disk. In other words, no other error codes can come out of 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 concluding remark<\/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 are now well equipped to create your own mappings from error codes to specific error codes. I fully understand that you do not have access to our GPower Custom Error Assistant or Application API, but these should primarily be seen as examples of how it CAN be done. It is not certain that all our rules will suit you, but choose the ones that work and make use of them. The most important thing is that you are consistent about it.   <\/p><p>Before I wrap up, I will answer the open question you may be sitting with. You may think it is strange that there is only room for 100 error codes in each group. But if you need 100 unique error codes without reuse within your API, then there are other issues to address, such as modularising your code.  <\/p><p>Please feel free to use the comments on LinkedIn if you have 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 on the API interface functions.<\/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 GPowers software developer, Jesper Kj\u00e6r S\u00f8rensen, on building robust software and test systems. Do you know the feeling&#8230;? There are three hours until the deadline for your assignment, and then it happens\u2014the one thing that must not happen. Your computer shows a \u201cBlue Screen of Death\u201d [&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":4,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23156\/revisions"}],"predecessor-version":[{"id":23182,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23156\/revisions\/23182"}],"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}]}}