Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Handle API errors gracefully with the Flutter SDK.
Law4DevsException (base) ├── NotFoundError (404) ├── ValidationError (400) ├── RateLimitError (429) └── ServerError (5xx)
Exception
message
statusCode
import 'package:law4devs/law4devs.dart'; try { final fw = await client.frameworks.get('nonexistent'); } on NotFoundError catch (e) { print('404: ${e.message}'); } on ValidationError catch (e) { print('400: ${e.message}'); } on RateLimitError catch (e) { print('429: Rate limited — SDK retried automatically'); } on ServerError catch (e) { print('${e.statusCode}: ${e.message}'); } on Law4DevsException catch (e) { print('API error ${e.statusCode}: ${e.message}'); }
429
5xx
404
400
Future<FrameworkDetail?> safeGet(Law4DevsClient client, String slug) async { try { return await client.frameworks.get(slug); } on NotFoundError { return null; } } final fw = await safeGet(client, 'unknown-slug'); if (fw != null) { print(fw.name); }
String
int?
Was this page helpful?