FAQ: I want to output the error log of a server script
## Answer
Use the try-catch statement and context.Log().
---
## Overview
When an error occurs in a "[Server Script](/en/manual/table-management-server-script)", an error message "A problem has occurred in the application" is usually displayed, and the error details are recorded in the system log.
When developing a server script, for example, if you want to check the error details immediately while displaying the screen without displaying an error message, you can catch the error (exception) with a try-catch statement and output logs to the Console as exception processing.
## Usage Example
##### JavaScript
```
try {
context.Log('Start processing');
const myItems = items.Get('aaaa'); // Pass a string to the argument
const myItem = myItems[0]; // Specify an array element even though myItems is null → Error
context.Log(myItem.Title);
context.Log('Processing completed');
} catch(e) {
context.Log('Error occurred');
// Error log output
context.Log(e.stack);
}
```
The log is output to the Console of the browser's developer tools as shown below. The developer tools are the screen that appears when you press the F12 key in major browsers such as Chrome.
w)
![image](https://pleasanter.org/binaries/b1e16d5d3fab46e5b068c86b64606c29)
## Related Information
<div id="ManualList"><ul><li><a href="/en/manual/table-management-server-script">Table Management: Server Script</a><span>08.13.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />