Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
69c76227
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
69c76227
编写于
6月 27, 2013
作者:
S
smarks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8019224: add exception chaining to RMI CGIHandler
Reviewed-by: darcy
上级
897358ee
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
10 deletion
+21
-10
src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
+21
-10
未找到文件。
src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
浏览文件 @
69c76227
...
...
@@ -38,6 +38,10 @@ class CGIClientException extends Exception {
public
CGIClientException
(
String
s
)
{
super
(
s
);
}
public
CGIClientException
(
String
s
,
Throwable
cause
)
{
super
(
s
,
cause
);
}
}
/**
...
...
@@ -50,6 +54,10 @@ class CGIServerException extends Exception {
public
CGIServerException
(
String
s
)
{
super
(
s
);
}
public
CGIServerException
(
String
s
,
Throwable
cause
)
{
super
(
s
,
cause
);
}
}
/**
...
...
@@ -148,13 +156,16 @@ public final class CGIHandler {
try
{
handler
.
execute
(
param
);
}
catch
(
CGIClientException
e
)
{
e
.
printStackTrace
();
returnClientError
(
e
.
getMessage
());
}
catch
(
CGIServerException
e
)
{
e
.
printStackTrace
();
returnServerError
(
e
.
getMessage
());
}
else
returnClientError
(
"invalid command."
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
returnServerError
(
"internal error: "
+
e
.
getMessage
());
}
System
.
exit
(
0
);
...
...
@@ -225,7 +236,7 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
port
=
Integer
.
parseInt
(
param
);
}
catch
(
NumberFormatException
e
)
{
throw
new
CGIClientException
(
"invalid port number."
);
throw
new
CGIClientException
(
"invalid port number."
,
e
);
}
if
(
port
<=
0
||
port
>
0xFFFF
)
throw
new
CGIClientException
(
"invalid port: "
+
port
);
...
...
@@ -238,7 +249,7 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
socket
=
new
Socket
(
InetAddress
.
getLocalHost
(),
port
);
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"could not connect to local port"
);
throw
new
CGIServerException
(
"could not connect to local port"
,
e
);
}
/*
...
...
@@ -249,9 +260,9 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
clientIn
.
readFully
(
buffer
);
}
catch
(
EOFException
e
)
{
throw
new
CGIClientException
(
"unexpected EOF reading request body"
);
throw
new
CGIClientException
(
"unexpected EOF reading request body"
,
e
);
}
catch
(
IOException
e
)
{
throw
new
CGIClientException
(
"error reading request body"
);
throw
new
CGIClientException
(
"error reading request body"
,
e
);
}
/*
...
...
@@ -266,7 +277,7 @@ final class CGIForwardCommand implements CGICommandHandler {
socketOut
.
write
(
buffer
);
socketOut
.
flush
();
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"error writing to server"
);
throw
new
CGIServerException
(
"error writing to server"
,
e
);
}
/*
...
...
@@ -276,7 +287,7 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
socketIn
=
new
DataInputStream
(
socket
.
getInputStream
());
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"error reading from server"
);
throw
new
CGIServerException
(
"error reading from server"
,
e
);
}
String
key
=
"Content-length:"
.
toLowerCase
();
boolean
contentLengthFound
=
false
;
...
...
@@ -286,7 +297,7 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
line
=
getLine
(
socketIn
);
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"error reading from server"
);
throw
new
CGIServerException
(
"error reading from server"
,
e
);
}
if
(
line
==
null
)
throw
new
CGIServerException
(
...
...
@@ -313,9 +324,9 @@ final class CGIForwardCommand implements CGICommandHandler {
socketIn
.
readFully
(
buffer
);
}
catch
(
EOFException
e
)
{
throw
new
CGIServerException
(
"unexpected EOF reading server response"
);
"unexpected EOF reading server response"
,
e
);
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"error reading from server"
);
throw
new
CGIServerException
(
"error reading from server"
,
e
);
}
/*
...
...
@@ -327,7 +338,7 @@ final class CGIForwardCommand implements CGICommandHandler {
try
{
System
.
out
.
write
(
buffer
);
}
catch
(
IOException
e
)
{
throw
new
CGIServerException
(
"error writing response"
);
throw
new
CGIServerException
(
"error writing response"
,
e
);
}
System
.
out
.
flush
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录