<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Haze</title>
    <description>The latest articles on DEV Community by Haze (@clearthehaze).</description>
    <link>https://dev.to/clearthehaze</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3760726%2Ffcf828d1-7b34-42fe-9532-b8646f5baf89.png</url>
      <title>DEV Community: Haze</title>
      <link>https://dev.to/clearthehaze</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/clearthehaze"/>
    <language>en</language>
    <item>
      <title>How we built an error explainer with Gemini</title>
      <dc:creator>Haze</dc:creator>
      <pubDate>Sun, 08 Feb 2026 23:12:14 +0000</pubDate>
      <link>https://dev.to/clearthehaze/how-we-built-an-error-explainer-with-gemini-n43</link>
      <guid>https://dev.to/clearthehaze/how-we-built-an-error-explainer-with-gemini-n43</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rpnqi7beatddy8ozvgs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rpnqi7beatddy8ozvgs.jpg" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
When you’re stuck on a cryptic error or a long stack trace, you usually want three things: &lt;strong&gt;what’s going on&lt;/strong&gt;, &lt;strong&gt;why it’s probably happening&lt;/strong&gt;, and &lt;strong&gt;what to do next&lt;/strong&gt;. We built &lt;a href="https://www.haze.no/" rel="noopener noreferrer"&gt;Haze&lt;/a&gt; to do exactly that - paste an error (or upload a screenshot), click once, and get a short, structured explanation instead of a wall of text.&lt;/p&gt;

&lt;p&gt;This post is a quick look at how we did it with &lt;strong&gt;Google’s Gemini&lt;/strong&gt; on Vertex AI - and why we made it a focused product instead of “just paste into ChatGPT.”&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Errors and stack traces are noisy. You don’t always need a long explanation - you need a clear &lt;strong&gt;summary&lt;/strong&gt;, a &lt;strong&gt;likely cause&lt;/strong&gt;, and a few &lt;strong&gt;next steps&lt;/strong&gt;. We wanted that in a fixed format every time so we could show it in a simple UI.&lt;/p&gt;

&lt;p&gt;We also wanted something &lt;strong&gt;dedicated&lt;/strong&gt;: no copying into a generic chatbot, no mixing your error with other tabs and context. One place, one click, one clear answer. That’s why we built Haze as a small product: free tier to try it, Pro for unlimited use when you rely on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The approach
&lt;/h2&gt;

&lt;p&gt;We use a &lt;strong&gt;React + Vite&lt;/strong&gt; front end and a &lt;strong&gt;Node&lt;/strong&gt; backend. The backend calls Vertex AI (Gemini) with two things: a system prompt that defines the tone and output shape, and a user message that is basically “here’s the error text.”&lt;/p&gt;

&lt;p&gt;The system prompt tells the model to act as “Haze,” stay calm and concise, and return only raw JSON with three fields: summary, likely_cause, and next_steps (a short list of actions). We also ask for JSON in the API request so the model is nudged toward valid output. That way we can parse one object and render it—no markdown or extra commentary.&lt;/p&gt;

&lt;p&gt;If the API fails or returns something we can’t use, we fall back to a simple rule-based analyzer so the user always gets something in the same format. We also retry a couple of times on rate-limit errors so the odd 429 doesn’t break the flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;p&gt;Keeping the output &lt;strong&gt;strict and JSON-only&lt;/strong&gt; made the integration straightforward: one parse, one shape, no scraping text out of paragraphs. A single, clear system prompt did most of the work; we didn’t need a long back-and-forth or multiple calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it (or go Pro)
&lt;/h2&gt;

&lt;p&gt;You can try Haze at &lt;a href="https://www.haze.no/" rel="noopener noreferrer"&gt;haze.no&lt;/a&gt; - paste any error or stack trace and hit “Clear the haze.” &lt;strong&gt;10 explanations per month are free&lt;/strong&gt; (no signup required to try); sign up with email or Google/GitHub to track usage across devices. If you clear the haze a lot, &lt;strong&gt;Pro is $9/month&lt;/strong&gt; for unlimited use - &lt;a href="https://www.haze.no/pricing" rel="noopener noreferrer"&gt;pricing and contact here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’re thinking of adding an “explain this error” feature to an app or a small product, this pattern—system prompt + JSON response + simple fallback—is a solid starting point. If you’d rather not build it yourself, Haze is built for exactly that: one place, one click, clear answers.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>googlecloud</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
