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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 2, 2025

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

      June 2, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 2, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 2, 2025

      How Red Hat just quietly, radically transformed enterprise server Linux

      June 2, 2025

      OpenAI wants ChatGPT to be your ‘super assistant’ – what that means

      June 2, 2025

      The best Linux VPNs of 2025: Expert tested and reviewed

      June 2, 2025

      One of my favorite gaming PCs is 60% off right now

      June 2, 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

      `document.currentScript` is more useful than I thought.

      June 2, 2025
      Recent

      `document.currentScript` is more useful than I thought.

      June 2, 2025

      Adobe Sensei and GenAI in Practice for Enterprise CMS

      June 2, 2025

      Over The Air Updates for React Native Apps

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

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025
      Recent

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025

      Microsoft says Copilot can use location to change Outlook’s UI on Android

      June 2, 2025

      TempoMail — Command Line Temporary Email in Linux

      June 2, 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.

    Hostinger

    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

    How Red Hat just quietly, radically transformed enterprise server Linux

    June 2, 2025
    News & Updates

    OpenAI wants ChatGPT to be your ‘super assistant’ – what that means

    June 2, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Why you should ignore 99% of AI tools – and which four I use every day

    News & Updates
    Unveiling Attention Sinks: The Functional Role of First-Token Focus in Stabilizing Large Language Models

    Unveiling Attention Sinks: The Functional Role of First-Token Focus in Stabilizing Large Language Models

    Machine Learning

    Postman introduces new features to enable “secure by design” API development

    Tech & Work

    Microsoft confirms Windows 11 24H2 now rolling out to more PCs despite major issues

    Development
    Hostinger

    Highlights

    LPub3D is an LDraw editor for LEGO style digital building instructions

    May 3, 2025

    LPub3D is a WYSIWYG editing application for creating LEGO style digital building instructions. The post…

    Assassin’s Creed Shadows is the best-selling game of March 2025 in the US

    April 23, 2025

    Multi-Shot AIs: The End of Human Jobs?

    August 31, 2024

    Why KFC and Taco Bell may be most Americans’ first taste of AI agents

    March 20, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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