Skip to content

Commit ec0451a

Browse files
Potential fix for code scanning alert no. 3: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent f21ab6d commit ec0451a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/directadmin_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def create_forwarder(self, address, destination):
442442
print(f"Error creating forwarder: {e}")
443443
import traceback
444444
traceback.print_exc()
445-
return False, str(e)
445+
return False, "An error occurred while creating the forwarder"
446446

447447
def delete_forwarder(self, address):
448448
"""Delete an email forwarder"""

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def create_forwarder():
180180
})
181181
else:
182182
return jsonify({
183-
'error': message
183+
'error': 'Failed to create forwarder'
184184
}), 400
185185

186186
except Exception as e:

0 commit comments

Comments
 (0)