You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Susmit Sarkar (Jira)" <ji...@apache.org> on 2021/08/19 07:24:00 UTC
[jira] [Updated] (SSHD-1209) Write to error stream for custom
exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Susmit Sarkar updated SSHD-1209:
--------------------------------
Description:
Hello Team,
We have a class as below
{code:java}
DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware {
{code}
and we have overridden the :
resolveErrorMessage and setIoErrorStream(IoOutputStream errStream)
{code:java}
@Override
public void setIoErrorStream(IoOutputStream errStream) {
this.errStream = errStream;
}
{code}
finally we are writing to the error stream:
{code:java}
private void writeMsgToErrorStream(String refinedUserExitMessage) {
ByteArrayBuffer buf = new ByteArrayBuffer();
buf.putString(refinedUserExitMessage + System.getProperty("line.separator"));
try { if (errStream != null) {
errStream.writeBuffer(buf);
}
} catch (Exception e) {
}
}
{code}
Once the data is written to error stream we are gettig proper message to the console:
!image-2021-08-19-12-50-01-922.png!
But there is an extra charater getting appended at the first character *<* Utils.java ....
I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z*
Any help will be appreciated.
Thanks,
Susmit
was:
Hello Team,
We have a class as below
{code:java}
DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware {
{code}
and we have overridden the :
resolveErrorMessage and setIoErrorStream(IoOutputStream errStream)
{code:java}
@Override
public void setIoErrorStream(IoOutputStream errStream) {
this.errStream = errStream;
}
{code}
finally we are writing to the error stream:
{code:java}
private void writeMsgToErrorStream(String refinedUserExitMessage) {
ByteArrayBuffer buf = new ByteArrayBuffer();
buf.putString(refinedUserExitMessage + System.getProperty("line.separator"));
try { if (errStream != null) {
errStream.writeBuffer(buf);
}
} catch (Exception e) {
}
}
{code}
Once the data is written to error stream we are gettig proper message to the console:
!image-2021-08-19-12-50-01-922.png!
But there is an extra charater getting appended at the first character *<*Utils.java ....
I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z*
Any help will be appreciated.
Thanks,
Susmit
> Write to error stream for custom exception is appending a extra word at the beginning
> -------------------------------------------------------------------------------------
>
> Key: SSHD-1209
> URL: https://issues.apache.org/jira/browse/SSHD-1209
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.7.0
> Reporter: Susmit Sarkar
> Priority: Major
> Attachments: image-2021-08-19-12-50-01-922.png
>
>
> Hello Team,
>
> We have a class as below
>
> {code:java}
> DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware {
> {code}
> and we have overridden the :
>
> resolveErrorMessage and setIoErrorStream(IoOutputStream errStream)
> {code:java}
> @Override
> public void setIoErrorStream(IoOutputStream errStream) {
> this.errStream = errStream;
> }
> {code}
> finally we are writing to the error stream:
> {code:java}
> private void writeMsgToErrorStream(String refinedUserExitMessage) {
> ByteArrayBuffer buf = new ByteArrayBuffer();
> buf.putString(refinedUserExitMessage + System.getProperty("line.separator"));
> try { if (errStream != null) {
> errStream.writeBuffer(buf);
> }
> } catch (Exception e) {
> }
> }
> {code}
> Once the data is written to error stream we are gettig proper message to the console:
> !image-2021-08-19-12-50-01-922.png!
> But there is an extra charater getting appended at the first character *<* Utils.java ....
> I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z*
> Any help will be appreciated.
> Thanks,
> Susmit
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org