JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
GLException.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright (c) 2014 JogAmp Community. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * - Redistribution of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistribution in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of Sun Microsystems, Inc. or the names of
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * This software is provided "AS IS," without a warranty of any kind. ALL
21 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
22 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
23 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
24 * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
25 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
26 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
27 * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
28 * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
29 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
30 * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
31 * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that this software is not designed or intended for use
34 * in the design, construction, operation or maintenance of any nuclear
35 * facility.
36 *
37 * Sun gratefully acknowledges that this software was originally authored
38 * and developed by Kenneth Bradley Russell and Christopher John Kline.
39 */
40
41package com.jogamp.opengl;
42
43/** A generic exception for OpenGL errors used throughout the binding
44 as a substitute for {@link RuntimeException}. */
45@SuppressWarnings("serial")
46public class GLException extends RuntimeException {
47 /** Constructs a GLException object. */
48 public GLException() {
49 super();
50 }
51
52 /** Constructs a GLException object with the specified detail
53 message. */
54 public GLException(final String message) {
55 super(message);
56 }
57
58 /** Constructs a GLException object with the specified detail
59 message and root cause. */
60 public GLException(final String message, final Throwable cause) {
61 super(message, cause);
62 }
63
64 /** Constructs a GLException object with the specified root
65 cause. */
66 public GLException(final Throwable cause) {
67 super(cause);
68 }
69
70 /**
71 * Constructs a GLException object with the specified root
72 * cause with a decorating message including the current thread name.
73 * @since 2.2
74 */
75 public static GLException newGLException(final Throwable t) {
76 return new GLException("Caught "+t.getClass().getSimpleName()+": "+t.getMessage()+" on thread "+Thread.currentThread().getName(), t);
77 }
78}
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
GLException(final String message)
Constructs a GLException object with the specified detail message.
static GLException newGLException(final Throwable t)
Constructs a GLException object with the specified root cause with a decorating message including the...
GLException(final Throwable cause)
Constructs a GLException object with the specified root cause.
GLException()
Constructs a GLException object.
GLException(final String message, final Throwable cause)
Constructs a GLException object with the specified detail message and root cause.