Skip to main content
Glama

filesystem-mcp

by sylphxltd
error-utils.test.ts1.72 kB
import { describe, it, expect } from 'vitest'; import { formatFileProcessingError } from '../../src/utils/error-utils'; describe('errorUtils', () => { describe('formatFileProcessingError', () => { it('should handle ENOENT errors', () => { const error = new Error('Not found'); (error as any).code = 'ENOENT'; const result = formatFileProcessingError(error, '/path', 'file.txt', '/project'); expect(result).toContain('File not found at resolved path'); }); it('should handle EACCES errors', () => { const error = new Error('Permission denied'); (error as any).code = 'EACCES'; const result = formatFileProcessingError(error, '/path', 'file.txt', '/project'); expect(result).toContain('Permission denied for file'); }); it('should handle generic Error objects', () => { const result = formatFileProcessingError( new Error('Test error'), '/path', 'file.txt', '/project', ); expect(result).toContain('Failed to process file file.txt: Test error'); }); it('should handle non-Error objects', () => { const result = formatFileProcessingError('string error', '/path', 'file.txt', '/project'); expect(result).toContain('Failed to process file file.txt: string error'); }); it('should handle null/undefined errors', () => { const result1 = formatFileProcessingError(null, '/path', 'file.txt', '/project'); expect(result1).toContain('Failed to process file file.txt: null'); const result2 = formatFileProcessingError(undefined, '/path', 'file.txt', '/project'); expect(result2).toContain('Failed to process file file.txt: undefined'); }); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sylphxltd/filesystem-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server