Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 1, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 1, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 1, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 1, 2025

      7 MagSafe accessories that I recommend every iPhone user should have

      June 1, 2025

      I replaced my Kindle with an iPad Mini as my ebook reader – 8 reasons why I don’t regret it

      June 1, 2025

      Windows 11 version 25H2: Everything you need to know about Microsoft’s next OS release

      May 31, 2025

      Elden Ring Nightreign already has a duos Seamless Co-op mod from the creator of the beloved original, and it’ll be “expanded on in the future”

      May 31, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Student Record Android App using SQLite

      June 1, 2025
      Recent

      Student Record Android App using SQLite

      June 1, 2025

      When Array uses less memory than Uint8Array (in V8)

      June 1, 2025

      Laravel 12 Starter Kits: Definite Guide Which to Choose

      June 1, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025
      Recent

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025

      Le notizie minori del mondo GNU/Linux e dintorni della settimana nr 22/2025

      June 1, 2025

      Rilasciata PorteuX 2.1: Novità e Approfondimenti sulla Distribuzione GNU/Linux Portatile Basata su Slackware

      June 1, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Finally, a Null

    CodeSOD: Finally, a Null

    February 12, 2025

    Eric writes:

    Yes, we actually do have code reviews and testing practices. A version of this code was tested successfully prior to this version being merged in, somehow.

    Well, that’s ominous. Let’s look at the code.

    public static SqsClient create()
    {
        try {
            SqsClient sqsClient = SqsClient.builder() ... .build();
            return sqsClient;
        } catch (Exception e) {
            log.error("SQS - exception creating sqs client", e);
        } finally {
            // Uncomment this to test the sqs in a test environment
            // return SqsClient.builder(). ... .build();
            return null;
        }
    }
    

    Eric found this when he discovered that the application wasn’t sending messages to their queue. According to the logs, there were messages to send, they just weren’t being sent.

    Eric made the mistake of looking for log messages around sending messages, when instead he should have been looking at module startup, where the error message above appeared.

    This code attempts to create a connection, and if it fails for any reason, it logs an error and returns null. With a delightful “comment this out” for running in the test environment, which, please, god no. Don’t do configuration management by commenting out lines of code. Honestly, that’s the worst thing in this code, to me.

    In any case, the calling code “properly” handled nulls by just disabling sending to the queue silently, which made this harder to debug than it needed to be.

    [Advertisement]
    BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleSSH into Raspberry Pi from Outside Home Network Using Tailscale
    Next Article MystiQ – GUI for FFmpeg

    Related Posts

    News & Updates

    7 MagSafe accessories that I recommend every iPhone user should have

    June 1, 2025
    News & Updates

    I replaced my Kindle with an iPad Mini as my ebook reader – 8 reasons why I don’t regret it

    June 1, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Barack Obama says AI is already better than “70% of coders,” but Bill Gates argues that programming is still too complex for AI to totally replace humans

    News & Updates

    CVE-2025-4244 – Code-Projects Online Bus Reservation System SQL Injection

    Common Vulnerabilities and Exposures (CVEs)

    Ubuntu 24.04 Update Fixes Several Touchscreen Quirks

    Linux

    Zero Day: Robert De Niro Tackles a Devastating Cyberattack in Netflix’s Thrilling New Series

    Development

    Highlights

    Qsynth is a Qt GUI interface for FluidSynth

    April 6, 2025

    This software aims to bring a simple but effective software synthesizer front end to the…

    New Android Banking Trojan Targets More Than 750 Financial and Crypto Apps

    March 31, 2025

    Take the Annual State of Laravel 2024 Survey

    July 27, 2024

    Oracle ERP Test Automation Guide – Examples and Best Practices

    April 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.