import {
TakoException,
TakoUnauthorizedException,
TakoRateLimitException,
} from 'tako-sdk';
try {
const results = await tako.knowledgeSearch(query);
} catch (error) {
if (error instanceof TakoUnauthorizedException) {
console.error('Authentication error:', error.message);
} else if (error instanceof TakoRateLimitException) {
console.error('Rate limit exceeded:', error.message);
} else if (error instanceof TakoNotFoundException) {
console.error('Resource not found:', error.message);
} else if (error instanceof TakoException) {
console.error('API error:', error.message);
} else {
console.error('Unexpected error:', error);
}
}