@@ -38,8 +38,8 @@ func TestHandleLlamaStackClientError(t *testing.T) {
3838 expectedBodyContains : "unauthorized" ,
3939 },
4040 {
41- name : "LlamaStackError with ModelNotFound code" ,
42- inputError : llamastack .NewModelNotFoundError ( "gpt-4 " ),
41+ name : "LlamaStackError with NotFound code" ,
42+ inputError : llamastack .NewNotFoundError ( "resource not found " ),
4343 expectedStatusCode : http .StatusNotFound ,
4444 expectedBodyContains : "not_found" ,
4545 },
@@ -94,8 +94,8 @@ func TestGetDefaultStatusCodeForLlamaStackClientError(t *testing.T) {
9494 expectedStatusCode : http .StatusUnauthorized ,
9595 },
9696 {
97- name : "ModelNotFound code returns 404" ,
98- errorCode : llamastack .ErrCodeModelNotFound ,
97+ name : "NotFound code returns 404" ,
98+ errorCode : llamastack .ErrCodeNotFound ,
9999 expectedStatusCode : http .StatusNotFound ,
100100 },
101101 {
@@ -165,11 +165,11 @@ func TestMapLlamaStackClientErrorToHTTPError(t *testing.T) {
165165 },
166166 {
167167 name : "not found error" ,
168- lsErr : llamastack .NewModelNotFoundError ( "gpt-4 " ),
168+ lsErr : llamastack .NewNotFoundError ( "resource not found " ),
169169 statusCode : http .StatusNotFound ,
170170 expectedCode : "not_found" ,
171171 expectedStatusCode : http .StatusNotFound ,
172- expectedMessage : "model 'gpt-4' not found or is not available " ,
172+ expectedMessage : "resource not found" ,
173173 },
174174 {
175175 name : "service unavailable error" ,
@@ -236,17 +236,17 @@ func TestLlamaStackHelpersIntegration(t *testing.T) {
236236 assert .Contains (t , rr .Body .String (), "input is required" )
237237 })
238238
239- t .Run ("should handle LlamaStackError with model not found" , func (t * testing.T ) {
239+ t .Run ("should handle LlamaStackError with not found" , func (t * testing.T ) {
240240 req := httptest .NewRequest ("GET" , "/test" , nil )
241241 rr := httptest .NewRecorder ()
242242
243- lsErr := llamastack .NewModelNotFoundError ( "gpt-4 " )
243+ lsErr := llamastack .NewNotFoundError ( "resource not found " )
244244
245245 app .handleLlamaStackClientError (rr , req , lsErr )
246246
247247 assert .Equal (t , http .StatusNotFound , rr .Code )
248248 assert .Contains (t , rr .Body .String (), `"code": "not_found"` )
249- assert .Contains (t , rr .Body .String (), "gpt-4 " )
249+ assert .Contains (t , rr .Body .String (), "resource not found " )
250250 })
251251
252252 t .Run ("should fall back to serverErrorResponse for unknown error type" , func (t * testing.T ) {
0 commit comments