[PR #646] [CLOSED] Prevent HipChat API failure from throwing an exception #1275

Closed
opened 2026-03-04 03:08:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/646
Author: @alextartan
Created: 9/16/2015
Status: Closed

Base: masterHead: master


📝 Commits (2)

  • bea629e Update HipChatHandler.php
  • cfa4b33 Merge pull request #1 from alextartan/alextartan-patch-hipchat-write

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 src/Monolog/Handler/HipChatHandler.php (+6 -2)

📄 Description

When a connection to HipChat API cannot be established, the 'createSocketResource' method from the 'SocketHandler' class throws an exception.

To prevent this, I've wrapped the "write" method from the 'HipChatHandler' class in a try-catch block. While the call specifically throws an 'UnexpectedValueException', the catch is using '\Exception' since no action is actually needed and the exception type doesn't really matter is this particular case.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/646 **Author:** [@alextartan](https://github.com/alextartan) **Created:** 9/16/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`bea629e`](https://github.com/Seldaek/monolog/commit/bea629e6d82e9804c3a08791ec4031182325c086) Update HipChatHandler.php - [`cfa4b33`](https://github.com/Seldaek/monolog/commit/cfa4b33155e8c7f9c18f945768f085d4b30f648c) Merge pull request #1 from alextartan/alextartan-patch-hipchat-write ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/Monolog/Handler/HipChatHandler.php` (+6 -2) </details> ### 📄 Description When a connection to HipChat API cannot be established, the 'createSocketResource' method from the 'SocketHandler' class throws an exception. To prevent this, I've wrapped the "write" method from the 'HipChatHandler' class in a try-catch block. While the call specifically throws an 'UnexpectedValueException', the catch is using '\Exception' since no action is actually needed and the exception type doesn't really matter is this particular case. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:08:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1275
No description provided.