MediaAttacher::download() only caught RuntimeException, but a connection-level failure throws Illuminate\Http\Client\ConnectionException (extends Exception, not RuntimeException) — e.g. a slow/unreachable proxy hitting the 20s timeout. On the API hosting path that propagated as a 500 (not the promised 422), skipped the batch rollback (orphaning an already-hosted item), and leaked the temp file. Catch Throwable so any fetch failure returns null → the caller rejects cleanly with 422 and rolls back. Also hardens the existing MCP/REST attach-from-url paths (a timeout there now reports a failed URL instead of 500). |
||
|---|---|---|
| .. | ||
| Feature | ||
| fixtures | ||
| Unit | ||
| CreatesApplication.php | ||
| Pest.php | ||
| TestCase.php | ||