File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,21 @@ form.addEventListener("submit", async (e) => {
1111 input . value = "" ;
1212
1313 try {
14- const response = await fetch ( "https://indicatiehulp-fn-py .azurewebsites.net/api/chatproxy" , {
14+ const response = await fetch ( "https://chatproxy .azurewebsites.net/api/chatproxy" , {
1515 method : "POST" ,
1616 headers : { "Content-Type" : "application/json" } ,
1717 body : JSON . stringify ( { message } )
1818 } ) ;
1919
20+ if ( ! response . ok ) {
21+ throw new Error ( `Serverfout (${ response . status } )` ) ;
22+ }
23+
2024 const result = await response . json ( ) ;
2125 appendMessage ( "Agent" , result . tool_output || "Geen antwoord ontvangen." ) ;
2226 } catch ( err ) {
2327 appendMessage ( "Agent" , "Er ging iets mis." ) ;
24- console . error ( err ) ;
28+ console . error ( "Fout in webchat:" , err ) ;
2529 }
2630} ) ;
2731
You can’t perform that action at this time.
0 commit comments