Resolve AT Protocol DIDs, handles, and schemas with intelligent caching for Laravel
at main 769 B view raw
1<?php 2 3namespace SocialDept\AtpResolver\Exceptions; 4 5class HandleResolutionException extends ResolverException 6{ 7 /** 8 * Create a new exception for invalid handle format. 9 * 10 * @param string $handle 11 */ 12 public static function invalidFormat(string $handle): self 13 { 14 return new self("Invalid handle format: {$handle}"); 15 } 16 17 /** 18 * Create a new exception for resolution failure. 19 * 20 * @param string $handle 21 * @param string $reason 22 */ 23 public static function resolutionFailed(string $handle, string $reason = ''): self 24 { 25 $message = "Failed to resolve handle: {$handle}"; 26 27 if ($reason) { 28 $message .= " ({$reason})"; 29 } 30 31 return new self($message); 32 } 33}