1 /*
2 * Copyright (c) 2002-2025 Gargoyle Software Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * https://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 package org.htmlunit.javascript;
16
17 import java.io.Serializable;
18 import java.net.MalformedURLException;
19 import java.net.URL;
20
21 import org.htmlunit.ScriptException;
22 import org.htmlunit.html.HtmlPage;
23
24 /**
25 * Silent implementation of {@link JavaScriptErrorListener} that does no logging at all.
26 *
27 * @author Ronald Brill
28 */
29 public class SilentJavaScriptErrorListener implements JavaScriptErrorListener, Serializable {
30
31 @Override
32 public void scriptException(final HtmlPage page, final ScriptException scriptException) {
33 // silence
34 }
35
36 @Override
37 public void timeoutError(final HtmlPage page, final long allowedTime, final long executionTime) {
38 // silence
39 }
40
41 @Override
42 public void malformedScriptURL(final HtmlPage page, final String url,
43 final MalformedURLException malformedURLException) {
44 // silence
45 }
46
47 @Override
48 public void loadScriptError(final HtmlPage page, final URL scriptUrl, final Exception exception) {
49 // nothing to do
50 }
51
52 @Override
53 public void warn(final String message, final String sourceName,
54 final int line, final String lineSource, final int lineOffset) {
55 // silence
56 }
57 }