Return insufficient_wallet when Transfer billing fails for zero balance.
Deploy Ladill Transfer / deploy (push) Successful in 29s

Expose a stable error_code on chunked upload finalize so webmail can prompt wallet top-up instead of a generic upload failure.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-08 17:13:19 +00:00
co-authored by Cursor
parent c173256ded
commit 151c15cb85
2 changed files with 25 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Support;
use RuntimeException;
class TransferWalletErrors
{
public const CODE_INSUFFICIENT_WALLET = 'insufficient_wallet';
public static function isInsufficientBalance(RuntimeException $e): bool
{
$message = strtolower($e->getMessage());
return str_contains($message, 'insufficient wallet')
|| str_contains($message, 'top up');
}
}